Error authenticating to a Nexus repository causes Package Manager Settings dialog to crash Visual Studio

Topics: General
Feb 21, 2013 at 10:39 AM
Edited Feb 21, 2013 at 10:42 AM
Hi,

I'm using NuGet 2.2, Visual Studio 2010 and 2.2.1.

When I open a Visual Studio solution for which NuGet has already been enabled, I still get the option to "Enable NuGet package resotre".
After clicking this feature, I get an error: "Value cannot be Null - Parameter name: source"

When opening the Package Manager settings from Visual Studio menu (Tools -> Library Package Manager -> Package Manager Settings -> Package Sources) Visual Studio crashes.

I believe the problem is the authentication to Nexus.
If I create a new temporary project and enable NuGet package restore on this project - I get a prompt for creadentials and I can authenticate to Nexus.
After I have authenticated, I can close the temporary project and open the original one - and everything works fine.

I there a way to force a re-login of NuGet to Nexus?

Thanks,
Eyal
Feb 13, 2014 at 9:38 AM
Hi, I have same problem.
But I get this error after add package manager repository hosted on my TeamCity instance.

When opening the Package Manager settings from Visual Studio menu (Tools -> Library Package Manager -> Package Manager Settings -> Package Sources) Visual Studio crashes.

Problem solve if close solution, go to package manager settings to repository list and then open solution again.

But after restart VS, I get this error again.
Feb 13, 2014 at 11:35 AM
Hi jiller,

The problem we had was because we attempted to authenticate automatically to Nexus.

When a project is set to "Enable NuGet package restore" a folder ".nuget" is created in the root of the solution.
In this folder, there is a file NuGet.config.

In this file, we defined a user and password to authenticate to Nexus:
<packageSourceCredentials>
   <Repository_x0020_Demo>
      <add key="Username" value="ServiceAccount" />
      <add key="Password" value="AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAdyuz9NLyB02g0i7f+2" />
    </Repository_x0020_Demo>
</packageSourceCredentials>
We started having the problem where VS crashes when the password of the service account changed.

Note that the NuGet.Config file exists for each user in "C:\Users\username\Application Data\NuGet\NuGet.Config" (Windows 7)
(and in "Documents and Settings" for Windows XP)

Hope it helps.

Thanks,
Eyal