Search code examples
windows-7visual-studio-2017nuget

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

  • 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.