最近在使用最新的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'.
完全相同的命令/源代码树可以使用nuget.exe 2.8.5完美还原。
构建机器是Windows 2008 R2,.NET 4.0(此构建映像上不允许4.5更新)和VS 2010。基本上,我们有许多针对特定组合(Windows,.NET,Visual Studio)进行配置的构建机器。
似乎2.8.6版本依赖于.NET 4.5,在没有该软件的机器上无法正常运行。