Nuget versioning issue with package restore

Visual Studio-2010Nuget

Visual Studio-2010 Problem Overview


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?

Visual Studio-2010 Solutions


Solution 1 - Visual Studio-2010

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 - Visual Studio-2010

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 - Visual Studio-2010

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 - Visual Studio-2010

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.

Solution 5 - Visual Studio-2010

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

Solution 6 - Visual Studio-2010

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionenashnashView Question on Stackoverflow
Solution 1 - Visual Studio-2010Pavel BakshyView Answer on Stackoverflow
Solution 2 - Visual Studio-2010Jeremy WigginsView Answer on Stackoverflow
Solution 3 - Visual Studio-2010XchaiView Answer on Stackoverflow
Solution 4 - Visual Studio-2010Dipendu PaulView Answer on Stackoverflow
Solution 5 - Visual Studio-2010Harry SarshoghView Answer on Stackoverflow
Solution 6 - Visual Studio-2010jbookerView Answer on Stackoverflow