Nuget versioning issue with package restore

I am unable to install a package (using package restore) due to some kind of versioning issue with Nuget. Here are the steps I took:

build project: error : The schema version of 'MagicalUnicorn.MvcErrorToolkit' is incompatible with version 1.6.21205.9031 of NuGet. Please upgrade NuGet to the latest version from http://go.microsoft.com/fwlink/?LinkId=213942.

Extension manager says version is: 2.0.30619.9119.

Ok, restart VS as administrator, extension manager uninstall nuget. restart VS as administrator again, search for nuget and install.

Extension manager again says version is: 2.0.30619.9119.

rebuild project: error : The schema version of 'MagicalUnicorn.MvcErrorToolkit' is incompatible with version 1.6.21205.9031 of NuGet. Please upgrade NuGet to the latest version from http://go.microsoft.com/fwlink/?LinkId=213942.

Ok, so restart VS as administrator, extension manager uninstall nuget again. This time download from http://visualstudiogallery.msdn.microsoft.com/27077b70-9dad-4c64-adcf-c7cf6bc9970c Run the installer, all seems ok.

Extension manager again says version is: 2.0.30619.9119.

rebuild project: error : The schema version of 'MagicalUnicorn.MvcErrorToolkit' is incompatible with version 1.6.21205.9031 of NuGet. Please upgrade NuGet to the latest version from http://go.microsoft.com/fwlink/?LinkId=213942.

Grr! Any ideas?


Solution 1:

It looks like problem in nuget command line tool. When you enable 'Nuget package restore' feature it adds .nuget folder to you solution with nuget.exe. And when you compile project this tool is using to download missing packages, not VS extension is used here. So try update this tool from command line:

cd .nuget
nuget.exe update -Self

Procedure screenshot:

enter image description here

Solution 2:

The following worked for me in Visual Studio 2012:

  • Run VS 2012 as Administrator
  • Click Tools -- Extensions and Updates
  • In the left nav, Updates -- Visual Studio Gallery
  • Click Update on NuGet Package Manager
  • Install the update
  • Restart Visual Studio

Solution 3:

None of the offered solutions worked for me (Visual Studio 2013, Nuget Package Manager Version 2.8.5).

I had same error but it was saying I had version 2.5.4.

I fixed it by going to Tools > Nuget Manager Console > Nuget Package Console. This open's up a command line window. At the top of the window was a prompt to download missing packages for my project.

Pressed the download button and errors went away upon build.

Solution 4:

I was facing the same issue. I resolved it by selecting Tools on VS 2010 Menu --> Library Package Manager --> Package Manager Settings --> Check "Automatically check for updates". After that I restarted VS and was prompted for Nuget Update Installation. Once the update was installed, the Nuget package, HTTP Client in my case, got installed smoothly.