41

I am trying to install 'WindowsAzure.Storage 8.0.1' in visual studio 2012, but getting the error

package requires NuGet client version '2.12' or above, but the current NuGet version is '2.8.60318.667'.

on running command "Install-Package NuGet.Client"

Attempting to resolve dependency 'NuGet.Versioning (≥ 3.5.0)'.
Attempting to resolve dependency 'NuGet.Packaging (≥ 3.5.0)'.
Attempting to resolve dependency 'NuGet.Common (≥ 3.5.0)'.
Attempting to resolve dependency 'NuGet.Packaging.Core (≥ 3.5.0)'.
Attempting to resolve dependency 'NuGet.Packaging.Core.Types (≥ 3.5.0)'.
Attempting to resolve dependency 'NuGet.Frameworks (≥ 3.5.0)'.
Attempting to resolve dependency 'NuGet.Repositories (≥ 3.5.0)'.
Attempting to resolve dependency 'NuGet.RuntimeModel (≥ 3.5.0)'.
Attempting to resolve dependency 'Newtonsoft.Json (≥ 6.0.4)'.
Attempting to resolve dependency 'NuGet.ContentModel (≥ 3.5.0)'.
'NuGet.Client 3.5.0' already installed.

But still I am getting the error.

The 'WindowsAzure.Storage 8.0.1' package requires NuGet client version '2.12' or above, but the current NuGet version is '2.8.60318.667'.

1
  • Related post here.
    – RBT
    Commented Dec 8, 2017 at 5:46

11 Answers 11

74

Update your NuGet Package Manager extension. Go to Tools->Extensions and Updates and select Updates->Visual Studio Gallery. Update the NuGet Package Manager extension. Then try to install the package after Visual Studio gets restarted.

4
  • 6
    Note that the NuGet Update is in the Updates -> Visual Studio Gallery category. (I am using VS2013.) Commented Oct 12, 2017 at 7:24
  • 5
    Doesn`t work in VS 2012 Prof: 405 Method not allowed
    – torno
    Commented Jan 19, 2018 at 9:01
  • @torno That may because of a connectivity issue with your internet/firewall. Commented Jan 23, 2018 at 9:18
  • Just what I needed. Thanks! Commented May 1, 2018 at 4:48
44

NuGet 2.12 only supports Visual Studio 2013 and later. If you're on Visual Studio 2012 you're out of luck.

0
24

I struggled with this issue in Visual Studio 2010 when I was trying to add NewtonSoft.Json nuget package into my project. When I try to run the latest version of the nuget package from nuget package manager console:

PM> Install-Package Newtonsoft.Json

It results in the same error as mentioned by OP:

package requires NuGet client version '2.12' or above, but the current NuGet version is '2.8.60318.667'.

So I thought I would update the NuGet extension in Visual Studio first to latest version. But when I went into Tools -> Extensions and Updates window the Updates tab wasn't showing any update for Nuget extension. So it seems NuGet client version 2.12 isn't available/supported in Visual Studio 2010 at all. I was running out of options now.

So finally, I tried to install a specific lower version (6.0.3) of Newtonsoft.Json package deliberately this way:

PM> Install-Package Newtonsoft.Json {Your Project Name} 6.0.3

This worked successfully. Latest version of this package at the time of writing this post is 10.0.3 instead.

So, it might be the case that newer version of a nuget package is compatible with only latest version of nuget package manager. So sometimes explicitly installing a lower version of the package might help you. Older version of a nuget package will of course be compatible with older nuget extension in Visual Studio if it is not up-to-date.

The only caveat in this solution is that the functionalities present in lower version of the nuget package you target should suffice your current project needs. Good luck!

Note: Although I've elaborated this solution w.r.t. Visual Studio 2010 but you can try this work around for any Visual Studio version for that matter.

5
  • Whilst at home, I code casually only - I only have a VS2012 installation - and I cannot seem to update Nuget Package manager anymore. This is a great answer as it also showed me that I can still install dated packages (For my own needs of course). +1
    – Eon
    Commented Dec 31, 2017 at 15:48
  • 1
    Awesome!! Learned something useful there :)
    – Nicki
    Commented Feb 26, 2018 at 10:38
  • for me it was Install-Package Newtonsoft.Json -Version 6.0.3
    – Ameji012
    Commented Sep 27, 2019 at 12:15
  • I tried one by one from the latest to the least version, and 9.0.1 work for me Install-Package Newtonsoft.Json -Version 9.0.1 Commented Mar 16, 2020 at 16:56
  • I had same problem in VS2012 and though the latest version at the time is 12.0.3 the working version is 9.0.1
    – ALIRA
    Commented Nov 16, 2020 at 10:13
17

I find out the solution for this problem.

Basically you have a .nuget folder at solution level, that folder contains a nuget.exe file that probably is old. A lot of packages might need new version of that file.

  1. Open this link: https://www.nuget.org/downloads
  2. Download latest version of nuget.exe
  3. Replace your .nuget/nuget.exe with this new version.

And try again, I'm confident it will work.

3
  • 1
    OMG Thank you so much! This is exactly what I needed. I was looking up all of this complicated stuff about editing build scripts. I should have realized I just needed to update the EXE in the project. Thanks!
    – Pinski
    Commented Sep 12, 2018 at 1:38
  • Thanks for the trick. Unfortunately the 2.12 version is not there (which is the one many packages are using)
    – tigrou
    Commented Jun 19, 2019 at 12:55
  • 1
    I could not find any .nuget folder in my solution and neither there is any nuget.exe in the whole computer...
    – bluish
    Commented Jul 3, 2019 at 10:03
3

try

nuget update -self

my result:

Checking for updates from https://www.nuget.org/api/v2/. 
Currently running NuGet.exe 2.8.7. 
Updating NuGet.exe to 5.3.1. 
Update successful.
0
1

This fix worked for me(I am using vs 2013, not sure if it will work for the rest), Go to Tools --> Extensions and Updates, then look for NuGet package manager for visual studio 2013, uninstall it. In the left pane select online which will take you to visual studio gallery, in the right pane search for NuGet package manager for visual studio 2013, it will bring you the right version to install. Install that and you are good to go, hope this sorts someone out.

1
Install-Package Newtonsoft.Json -Version 6.0.3
1
  • 1
    You can go up to 9.0.1
    – Rafael
    Commented Feb 23, 2022 at 13:45
0

I got the same issue and I just clicked on "Restore NuGet package for this solution". In my case this solved the problem. Hope it will help.

-2

I solved this problem, and my steps are as below:

1.Do what as "Mathivanan KP" said;

2.Delete the folder ".nuget", which is below your solution folder;

3.Rebuild your solution;

4.Back to your solution folder, and press "Ctrl + Z", then rebuild your solution again.

If the problem still there, i think you should clone the code from version manager to a new folder, and do the steps as before.

Hope it helpful to you.

-3

You are updating the wrong package. Update your Nuget Package Manager and the error will be gone.

Update-Package NuGet.VisualStudio

https://www.nuget.org/packages/NuGet.VisualStudio

1
  • Some dependent Dlls are not updated which may be causing the issue. If everything is installed and still not working, suggest downloading the VSIX and re-installing. Worked for me but I am on VS 2013. Download Link : nuget.codeplex.com/releases/view/118318 Commented Feb 11, 2017 at 9:17
-5

I try everything but nothing helps me. Than I change Visual Studio version from 2012 to 2015 everything is working Like a charm now.

2
  • 8
    This is not the answer to the question that you originally asked you should not mark it correct just because it is yours
    – Jay
    Commented Jun 26, 2017 at 15:00
  • I think he has resolved the issue by right way. NuGet 2.12 require VS 2013 or more. So, he UPGRADED [[he used the term change :) ]] Please consult the answer of Ceribia. Commented Feb 26, 2019 at 13:39

Not the answer you're looking for? Browse other questions tagged or ask your own question.