'Issues connecting to Nuget. Cannot turn off proxy
In Visual Studio 2017 I'm trying to connect to the nuget server to update some stuff, but I'm getting this error:
[nuget.org] Unable to load the service index for source https://api.nuget.org/v3/index.json. An error occurred while sending the request. Unable to connect to the remote server
My work PC is behind some proxy because in Connections > Lan Settings > Use Automatic Configuration Script, there's this address: http://autoproxy.SomeDomain.com/autoproxy.cgi
If I uncheck this, I won't have access to the internet.
The odd thing is that I can see the contents of https://api.nuget.org/v3/index.json in a browse, but VS2017 cannot connect to it.
What alternatives do I have? Can I download the nuget package manually and just update using VS2017?
Solution 1:[1]
What alternatives do I have? Can I download the nuget package manually and just update using VS2017?
To resolve this issue, you can try to add proxy settings into Nuget.Config
file which store in C:\Users\<user name>\AppData\Roaming\NuGet
.
Refer to this link for details: Nuget Config Section & Nuget Proxy Settings.
Besides, if above not help you. Since you can access the contents of https://api.nuget.org/v3/index.json in a browse, you can create a local feed for those packages, so that you can save the downloaded the nuget package and just update using VS2017.
How to create you local feed and how to use the local feed, please check the details from my another answer.
Hope this helps.
Solution 2:[2]
Open the Windows "Proxy Settings" and verify that the proxy settings are set to automatic or if you use a .dat configuration that it is valid and not cached (somehow).
If none works try explicitly setting a new and valid proxy in the nuget.config file to force it going to the one you know that works.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Leo Liu-MSFT |
Solution 2 | Vedran Mandić |