Recently started getting errors on build machines using latest nuget.exe (2.8.6)
.nuget\nuget restore MySolution.sln
Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
Exact same command / source tree restores perfectly using nuget.exe 2.8.5
Build machine is Windows 2008 R2, .NET 4.0 (no 4.5 updates allowed on this build image) and VS 2010. Basically, we have a number of build machines that are configured for specific combinations (Windows, .NET, Visual Studio).
It feels like the 2.8.6 build took a dependency on .NET 4.5 that breaks on machines without it.
I raised this as an issue but, from what I have been told, there are no plans to fix it: https://github.com/NuGet/Home/issues/1611
The workaround is to use the NuGet.CommandLine 2.8.5 package which can be found on nuget.org:
Install-Package NuGet.CommandLine -Version 2.8.5
in the Package Manager Console.nuget.exe
) from the package's installation folder and use it to replace the NuGet 2.8.6 executable that you are currently using (i.e. in the .nuget\
folder).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