Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 271
enashnash Avatar asked Aug 20 '12 10:08

enashnash


People also ask

How do I force a NuGet package to restore?

Restore packages manually using Visual Studio Enable package restore by choosing Tools > Options > NuGet Package Manager. Under Package Restore options, select Allow NuGet to download missing packages. In Solution Explorer, right click the solution and select Restore NuGet Packages.

How do I change NuGet package version?

Right-click the Packages folder in the project, and select Update. This will update the NuGet package to the latest version. You can double-click the Add packages and choose the specific version.

Was not found it might have been deleted since NuGet restore?

It might have been deleted since NuGet restore. Otherwise, NuGet restore might have only partially completed, which might have been due to maximum path length restrictions. Here are some actions you can take to resolve this error: Add the /restore option to your MSBuild.exe command.

How do I install an older version of NuGet?

Right click on your project and *go to Manage NuGet Packages. Look at the below image. Select your Package and Choose the Version , which you wanted to install.


2 Answers

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

like image 66
Pavel Bakshy Avatar answered Sep 28 '22 09:09

Pavel Bakshy


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
like image 40
Jeremy Wiggins Avatar answered Sep 28 '22 10:09

Jeremy Wiggins