Visual Studio : NuGet Package Source requires credentials

BaltoStar picture BaltoStar · Mar 20, 2013 · Viewed 35k times · Source
Visual Studio 2012 > Tools > Options > Package Manager > Package Sources

I add a new Package Source pointing to a myget.org url :

http://www.myget.org/F/myfeed/

VS > Tools > Library Package Manager > Manage NuGet Packages for Solution...

I am now prompted for myget credentials. Obviously, it will be inconvenient for developers to have to manually enter credentials every time they work with myget packages.

This blog explains how to store credentials in the machine-level NuGet.config :

https://gist.github.com/xavierdecoster/3205826

but after I follow the steps, VS still prompts me for credentials.

Answer

Mike Perrenoud picture Mike Perrenoud · Feb 3, 2015

One approach is to use the sources command:

nuget.exe sources Add|Update -Name feedName -UserName user -Password secret

With this you can either add that source with the credentials or update an existing one. It works perfectly.