James
James

Reputation: 1842

NuGet; unable to get package as wrong version reported in Visual Studio 2012

I'm trying to build a solution but I get this error,

he 'Microsoft.Bcl.Build 1.0.14' package requires NuGet client version '2.8.1' or above, but the current NuGet version is '2.6.40619.9041'.

I've just upgraded NuGet package manager in Tools/"Extensions and Updates" which reports the version as 2.8.50313.31.

I've restarted VS2012, restarted the computer, cleaned the project and rebuilt, but I still can't get Visual Studio to recognise the new version and hence can't compile.

Thanks

Upvotes: 4

Views: 3754

Answers (3)

Pallavi
Pallavi

Reputation: 584

This worked for me in VS 2017 Enterprise-

  1. Right click your solution and go to "Manage NuGet Packages for Solution..."
  2. In the window that opens up, click the gear icon at the top right corner.
  3. Select "General" and click the "Clear Clear All NuGet Cache(s)" button. This will run for a few seconds depending on the size of your cache.
  4. Clean and rebuild your solution.

enter image description here enter image description here

Upvotes: 2

AmpLid
AmpLid

Reputation: 79

  1. Run Console (cmd) as Administrator
  2. Locate your .nuget folder that contains the NuGet.exe file (you may check error message to locate the path)
  3. execute this command NuGet.exe update -self

Took me all day to find that NuGet was bound to the individual project.

Upvotes: 8

James
James

Reputation: 1842

I had to use the package manager console and run

Install-Package Microsoft.Bcl.Build -Version 1.0.14

to get it to work manually.

Edit (5/11/2014). The problem is actually that Nuget gets bundled with the solution and it is this that needs upgrading. I did this by finding the directory in the project with the nuget.exe file in it (.nuget for me, YMMV) going to that directory and running nuget update -self. If you go with the original solution, you have to do this manually for each package. HTH.

Upvotes: 4

Related Questions