2

My NuGet package is not retrieving any search result and showing "Not able to Connect to Server". I tried all solutions below, mentioned in other answers:

  • Checked, I have no proxy variable http_proxy in my system variables
  • Not using any other proxy in IE
  • Deleted AppData\Roaming\Nuget\packages.config and restarted VS (packages.config has just one key which is of https://api.nuget.org/v3/index.json)
  • I am not able to access https://api.nuget.org/v3/index.json by my browser too
  • Tried installing packages by PM console, but no luck

Kindly suggest any other solutions. My current setup Visual Studio 2017, Nuget 4.2.0

Thank you so much!

TalhaAhmed
  • 60
  • 1
  • 7
  • Check for Pending Extension Updates. That resolves this issue. – Prateek Shrivastava Apr 10 '18 at 05:17
  • 1
    @TalhaAhmed, Since you could not access that server in your browser and you do not have any proxy setting on your PC, it probably caused by your network issue, you can check it after it disappear or you can check it on another PC. – Leo Liu Apr 10 '18 at 09:57
  • what do you get if you type `nslookup www.nuget.org` in cmd? – Francesco B. Apr 10 '18 at 20:31
  • also `tracert www.nuget.org`? – Francesco B. Apr 10 '18 at 20:33
  • Updated pending extensions. But, It's the network issue. I tried it on a different network and it worked. Not sure why it's not working on my current network. Thanks Leo – TalhaAhmed Apr 10 '18 at 21:25
  • Francesco: nslookup result: Name: apimgmths10.cloudapp.net Address: 13.66.39.44 Aliases: tracert: After 18 hops, request timeout and then Destination host unreachable. – TalhaAhmed Apr 10 '18 at 21:31

1 Answers1

3

Nuget not retrieving any packages or even connecting to api.nuget.org

In order to benefit other community members read this topic, I convert my comment to the answer with some more details info.

When we encounter the issue "Not able to Connect to Server", the reason for this issue in most cases is because the network is limited or the incorrect configuration in the nuget.config.

To resolve the network issue, first, we should check if we have proxy variable http_proxy in our system variables or in the IE browser, we could test it on another PC with same network. After we confirm we do not have any proxy in our PC, then we should to check if our network is limited. We could test it with a different net work.

To resolve the incorrect configuration in the nuget.config, we could delete nuget.config in the %appdata%\Nuget, then restart the Visual Studio to generate the new nuget.config.

According to your description in the question, you could not access that server in your browser and you do not have any proxy setting on your PC, it probably caused by your network issue, you can check it after it disappear or you can check it with a different network or you can contact IT of your company.

See this thread for some more details.

Hope this helps.

Leo Liu
  • 71,098
  • 10
  • 114
  • 135