Configure NuGet to work behind a proxy

If you work behind a proxy, when you try to add a NuGet package to your Visual Studio project, probably this message will compare in the output tab:

error: Failed to retrieve information from remote source ...
error: Response status code does not indicate success: 407 (Proxy Authentication Required).

It means that NuGet is trying to download the package, but the proxy is blocking him.

Open the file C:\Users\[YOUR_USER_NAME]\AppData\Roaming\NuGet\NuGet.Config and add inside the <configuration> <\configuration> tag the following:

<config>
	<add key="http_proxy" value="http://[YOUR_PROXY_ADDRESS]:[YOUR_PROXY_PORT]" />
</config>

replacing:

  • [YOUR_USER_NAME] with your Windows account name
  • [YOUR_PROXY_ADDRESS] with the address of the proxy
  • [YOUR_PROXY_PORT] with the port of the proxy

Open Visual Studio and NuGet should automatically restore the packages.

Marco Mengoli

Marco Mengoli
Software Engineering student at University of Bologna. I love to solve problems and experiment new things. I'm an enthusiast maker, I love to make lots of projects with my Iot boards. I found on electronics a new really enjoyable hobby. My favourite thematic is Software Engineering, in particular the continuous improvement of the quality of the products I develop and also the way I do it. View more in the About page

Creating a simple model and generate the database with EF Core 1.0

Creating a simple model and generate the database with EF Core 1.0 Continue reading

OpenCV 3, the Mat object

Published on April 20, 2016