Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NuGet unable to find the version of a package

Tags:

.net

nuget

Running the command

nuget.exe restore .\MySolution.sln 

gives this error:

Unable to find version '1.0.0' of package 'Microsoft.Net.Compilers'.

where the package has previously been installed and restored, but it has somehow become corrupt.

like image 512
Mathew Avatar asked Aug 03 '16 03:08

Mathew


People also ask

How do I find the NuGet package version?

In Visual Studio, use the Help > About Microsoft Visual Studio command and look at the version displayed next to NuGet Package Manager. Alternatively, launch the Package Manager Console (Tools > NuGet Package Manager > Package Manager Console) and enter $host to see information about NuGet including the version.

How do I fix a missing NuGet package?

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.


Video Answer


1 Answers

It turns out simply updating the NuGet version via

nuget.exe update -self 

to update from 2.8.0 to 3.4.4 was sufficient, and the package now restores correctly.

like image 126
Mathew Avatar answered Oct 04 '22 12:10

Mathew