jmrog / vscode-nuget-package-manager

An extension for Visual Studio Code that lets you easily add or remove .NET Core 1.1+ package references to/from your project's .csproj file using Code's Command Palette.
MIT License
34 stars 17 forks source link

Does not shows any result if the machine is behind a corporate proxy #18

Open aflorenzan opened 7 years ago

aflorenzan commented 7 years ago

I'm trying to add a reference to a Console Project through the Nuget Package Manager extension, and every name I type on the search bar has no results.

I want to specify that I'm in a corporate network that uses a proxy server to connect to the Internet.

jmrog commented 7 years ago

Thanks for this report, and sorry for my delay in responding (life getting in the way and all that). Just to make sure that I understand, is the issue that the extension doesn't give you any feedback to tell you that no results were found, or is the issue instead that it doesn't find any results (and tells you as much) when you are expecting that results should be found?

jmrog commented 7 years ago

If it is the latter issue, then it may be that I need to allow specifying proxy options in some way before attempting to fetch packages using node-fetch. As a note for myself, it looks like something along these lines would do it: https://github.com/Microsoft/react-native-windows/pull/963/files. However, I'll wait for you to confirm that this the issue is in fact that packages that should be retrieved are not being retrieved (and not just that no feedback is being shown), @aflorenzan.

aflorenzan commented 7 years ago

I guess it is both, does not give any feedback and does not find any results and it should. For example, if you search the keyword Microsoft it says on statusbar 'Searching NuGet...' for a while and then disappear.

Hope those lines use the VSCode proxy settings.

jmrog commented 7 years ago

Cool, thanks. I'll take care of this ASAP (and yes, I'll make sure the extension respects VSCode proxy settings).

jmrog commented 7 years ago

@aflorenzan The most recent release (v1.1.3) should now use the VSCode proxy settings when they are set. Please let me know if you still have issues.

jayd33m commented 6 years ago

Issue still occuring on latest extension., please reopen @jmrog As per VSCode proxy settings, if nothing is set it should be using env variables http and https. I get a network timeout when attempting download a nuget package. VSCode is working fine through company proxy which indicates the extension no good. thanks for helping fix it, great product, saves heaps of work adding assemblies manually

jmrog commented 6 years ago

@jayd33m Thanks for the report. Just to confirm, are you using v1.1.6 of the extension?

Either way, I wouldn't be surprised if the extension doesn't respect environment variables. I think I had assumed that the extension API (specifically, getConfiguration) would provide the correct fallback values, but that probably isn't right. I'll reopen this to investigate and fix.

jayd33m commented 6 years ago

Thanks heaps. I've managed to do it manually using nuget CLI, dotnet core cli. Happy to test whenever ready

Cheers Shaun

On 4 Dec 2017 10:52 pm, "Jason Rogers" notifications@github.com wrote:

@jayd33m https://github.com/jayd33m Thanks for the report. Just to confirm, are you using v1.1.6 of the extension?

Either way, I wouldn't be surprised if the extension doesn't respect environment variables. I think I had assumed that the extension API (specifically, getConfiguration) would provide the correct fallback values, but that probably isn't right. I'll reopen this to investigate and fix.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jmrog/vscode-nuget-package-manager/issues/18#issuecomment-348984797, or mute the thread https://github.com/notifications/unsubscribe-auth/ACOQc4ScB8128MTrGBIHTYv609BIFlSYks5s9AdHgaJpZM4NIRil .

jmrog commented 6 years ago

@jayd33m I haven't had much time lately to look into this issue, but I'd like to get it fixed, so I've cobbled something together quickly. Would you mind giving it a test and seeing whether it resolves your issue? If so, in order for you to test it, you'll need to download the package I've made here: https://github.com/jmrog/vscode-nuget-package-manager/blob/jr/18-proxy-fallback/dist/vscode-nuget-package-manager-1.1.7.vsix

If you're not sure how to install an extension from a distributed package like that, there are instructions here: https://code.visualstudio.com/docs/editor/extension-gallery#_install-from-a-vsix

If you're willing and able to test, please do that, make sure that you are using version 1.1.7 for testing, and then let me know whether your proxy env variables are respected as they ought to be. Thanks! And sorry, my time to develop and test this plugin has been very limited lately!

jayd33m commented 6 years ago

Hi Justin

It may very well be working. I'm still hitting an error though but it's now different and reports Reason, getaddrinfo ENOTFOUND

This might be due to my environment variable containing my username and password for proxy. Would your changes accommodate something this? HTTPS_PROXY = username:password@https://URL HTTP_PROXY = username:password@https://URL

Regards Shaun

On 8 Dec 2017 11:36, "Jason Rogers" notifications@github.com wrote:

@jayd33m https://github.com/jayd33m I haven't had much time lately to look into this issue, but I'd like to get it fixed, so I've cobbled something together rather quickly. Would you mind giving it a test and seeing whether it resolves your issue? If so, in order for you to test it, you'll need to download the package I've made here: https://github.com/jmrog/vscode-nuget-package-manager/ blob/jr/18-proxy-fallback/dist/vscode-nuget-package-manager-1.1.7.vsix

If you're not sure how to install an extension from a distributed package like that, there are instructions here: https://code.visualstudio.com/ docs/editor/extension-gallery#_install-from-a-vsix

If you're willing and able to test, please do that, make sure that you are using version 1.1.7, and let me know whether your proxy env variables are respected as they ought to be. Thanks!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jmrog/vscode-nuget-package-manager/issues/18#issuecomment-350163400, or mute the thread https://github.com/notifications/unsubscribe-auth/ACOQc0MPv5dBb1TWmYb1kuKDf598hEgcks5s-K6hgaJpZM4NIRil .

jmrog commented 6 years ago

@jayd33m Thanks for testing. I think the extension should accommodate that sort of thing. However, I also think the way you specified your username and password isn't correct. The username:password clause should be after https://, so it should look like this:

https://username:password@URL

Can you try that and then test the extension again?