What port is NuGet using when loading a package through Visual Studio

I am using VS 2010 (package manager console) to download NuGet packages (2.5.40416.9020/Latest). It uses the URL https://nuget.org/api/v2/ . This gives me an error as shown below.

Install-Package : An error occurred while loading packages from'https://nuget.org/api/v2/': The remote name could not be resolved: 'nuget.org' At line:1 char:16 + Install-Package <<<< Rx-Main + CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand 

But when I access the same URL through a browser, I can browse the site. I am on a corporate network, so a firewall can block the port (except for 80 and 443).

So, which port does NuGet use when downloading packages through the Package Manager Console (VS 2010)?

+4
source share
3 answers

https://nuget.org/api/v2/ means port 443 (standard port for HTTPS)

If you work on a corporate network, port 80 and 443 are usually redirected through a proxy server.

Most likely, for some reason, NuGet is not using your proxy settings, so it cannot find the proxy server and is stopped by the corporate firewall.

+4
source

Go to Program Files \ Microsoft Visual Studio 14.0 \ Common7 \ IDE \ devenv.exe.config

 Set ipv6 enabled from true to false 

  <system.net> <settings> <ipv6 enabled="false"/> </settings> </system.net> 
+3
source

I was not able to download the nugget package through the console, it threw an error, for example:

"Unable to connect remote server"

I followed the steps below and set ipv6 from true to false. This solved my problem.

 C:\Program Files\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe.config <system.net> <settings> <ipv6 enabled="false"/> </settings> </system.net> 
+1
source

Source: https://habr.com/ru/post/1484780/


All Articles