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.
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With