59
votes

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?

6
Do you use old or new project?Pavel Bakshy
It's a project I've been developing recently. It works fine on one machine then when I try to get it to run on another machine I get the error.enashnash
Another way to get past this is to use the switch -NoCache to allow it to ignore the incompatible packages in your cache.ferventcoder

6 Answers

117
votes

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

15
votes

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
2
votes

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.

1
votes

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.

0
votes

I faced to this problem and I checked all answers that were this page and at the end my problem did not solved. After lot of search on web I could update my nuget from original site

http://docs.nuget.org/docs/start-here/installing-nuget

and for example for vs2010 :

http://visualstudiogallery.msdn.microsoft.com/27077b70-9dad-4c64-adcf-c7cf6bc9970c

At this site select your version of VS and then update it .

Note : before installing nuget,close all Visual Studios and after install,Open your project. Thanks

0
votes

This above did not work for me, completely. There is one last step that is IMPORTANT to note. After downloading the latest nuget version, you may notice that the same error prints in the output window. The reason is due to the .nuget folder containing a NuGet.exe which specifies a version number.

The solution (for me and perhaps to those of your that did not resolve your issue with the above directions), is to

  1. Delete the .nuget folder from you solution.

  2. Right click your web project and click Enable Nuget Restore.

  3. The directions above should cause a NEW .nuget folder to be added, this time the NuGet.exe should be the newest version of nuget that you downloaded.