Visual Studio 2013 - can't update nuget.exe

I stumbled upon a very strange error when trying to compile one of our projects lately:

It says: 

The ‘Microsoft.Bcl.1.1.9’ package requires NuGet client version ‘2.8.1’ or above, but the current NuGet version is ‘2.7.4090675’.

Try 1: Use the command line to get more information

I tried to execute the suggested command line in the second error by myself as an admin - no use. I got the same error ;) 

 

Try 2: Checking the NuGet version and updating the NuGet Package Manager

I check with Visual Studio 2013 what NuGet version I have:

NuGet version 2.87.5

And - lo and behold! I have installed NuGet v 2.8.5! So why is it complaining?

I tried to uninstall and freshly install the NuGet Package Manager - no use.

 

Try 3: SOLVED - Update nuget.exe manually

Visual Studio is keeping its own nuget.exe for each solution (!) in a directory located at $(SolutionDirectory)\.nuget\nuget.exe along with a .targets and a .config file. In the targets-file you even see at the bottom a task "DownloadNuGet" that fetches the new version of nuget.exe.

Download the file manually from nuget.org (it is located at https://www.nuget.org/nuget.exe)  and copy it in the given directory. Then restart Visual Studio.

 

But why?

I am pretty sure, there is a more elegant version of updating nuget.exe for any given solution - and I couldn't actually locate the nuget.exe Visual Studio is actually referring to when it says in Tools -> Extensions and Updates that it has the NuGet Package Manager 2.8.5 installed. 

Anybody can help me out here?

Posted on May 20, 2014 and filed under code4ward, development, Visual Studio.