NuGet not working in VS2010

Nov 10, 2010 at 4:04 PM

After installing ASP.NET MVC 3 RC NuGet just returns the error as described at

Is anyone else experiencing this problem?



Nov 10, 2010 at 4:26 PM

Did you update the feed url as described in the release note document?

Nov 10, 2010 at 4:39 PM

It was already set to the correct feed.

The problem was caused by the old packages I had installed with "NuPack"

In the end I had to remove everything from the packages directory and go through each project and run an "update-package" for each package I had previously installed.

A pain, but it worked.

Nov 10, 2010 at 5:10 PM

So if I understand correctly, you have an existing project with installed packages, you upgraded NuGet, and now installing any package from the feed is causing this error? That's not good. I'll add something to the release notes, but I want to confirm exactly what the issue is.

Nov 10, 2010 at 5:14 PM

The issue is the we tweaked the format slightly and the old package's manifest file doesn't fill in certain properties, leaving them null, causing things to go wrong. This happens in the CTP2 build when you try to use CTP1 packages.

Nov 10, 2010 at 5:16 PM

Ah, the pains of pre-release software. Perhaps in the release notes, we can publish a command that will update everything with a bit of Powershell-Fu?

Nov 10, 2010 at 5:19 PM

It's called out in the release notes already. Null reference = old package. We could provide a migration tool but I'm not sure if it's worth it.

Nov 10, 2010 at 5:25 PM

Hi Phil,

Yes I had an existing project with packages installed using NuPack.

I then installed MVC 3 RC today and although I could list packages (from both GUI/Console) I couldn't install/update any.

I finally removed all packages from the packages directory and had to go through each project and run an update-package from the console to download the "NuGet supported format".

Nov 17, 2010 at 11:36 AM
Edited Nov 17, 2010 at 11:58 AM

EDIT: I think I've sorted it. I had to uninstall CTP2, re-install CTP1, uninstall all packages, check-in my changes to source control (I have no idea why but this seemed to be the magical step), install CTP2, get the packages I had before.


What do you mean 'finally removed all packages from the packages directory'?

- I can't uninstall them through the package manager because I get the Object Reference exception.

- If I manually delete the files from the directory in Windows Explorer then the Package Manager Console complains that it can't find the package when I try to install or update that package again 'Could not find a part of the path ...OLDPACKAGE.nupkg'. I get this error even when I try to install a completely different package (ie it can't find the old one I delete manually). I've tried delete the packages.config and removing the project references but that made no difference.

Nov 17, 2010 at 8:00 PM

Glad you got it working! Sorry for the inconvenience. These are some of the growing pains we're going to have while we're in the pre-release state. Once we release v1 RTM, we'll make sure from release to release that we have a migration path.