I am using VS 2010 (Package Manager Console) to download NuGet (2.5.40416.9020/Latest) packages. It uses URL https://nuget.org/api/v2/. It gives me error as 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 via browser then i am able to browse the site. I am on corporate network so firewall might block the port (Other than 80 and 443).
So which port is used by NuGet while downloading packages via Package Manager Console (VS 2010)?
Navigate to NuGet.org and search for the package you want to install. Select Package Manager, and then copy the Install-Package command. In Visual Studio, select Tools > NuGet Package Manager > Package Manager Console to open the package manager console.
The NuGet CLI restore command downloads and installs any missing packages. The command works on projects that use either PackageReference or packages.
https://nuget.org/api/v2/
means port 443 (the standard port for HTTPS)
If you're on a corporate network, port 80 and 443 are usually bounced through a proxy server.
Most likely, NuGet is not using your proxy settings for some reason, so it cannot find the proxy server and are stopped by the corporate firewall.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With