Package requires NuGet client version '2.12'

前端 未结 11 1250
生来不讨喜
生来不讨喜 2021-02-03 19:21

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 abov

相关标签:
11条回答
  • 2021-02-03 19:49

    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.

    0 讨论(0)
  • 2021-02-03 19:52

    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.

    0 讨论(0)
  • 2021-02-03 19:54
    Install-Package Newtonsoft.Json -Version 6.0.3
    
    0 讨论(0)
  • 2021-02-03 19:55

    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.

    0 讨论(0)
  • 2021-02-03 19:56

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

    0 讨论(0)
  • 2021-02-03 19:57

    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.

    0 讨论(0)
提交回复
热议问题