I am pretty sure this is a nuget problem, but I'll ask here in case anyone has a solution.
We have a build agent which has .net 4.0 and NOT .net 4.5
We have this to avoid the exact issue which nuget seems to have with thier build system.
The issue is described almost exactly in this SO question:
This only happened after upgrading from TC 8.1 to 9.1.4
On a build agent without .net 4.5 installed I have this error:
The 'Microsoft.Bcl.Build 1.0.14' package requires NuGet client version '2.8.1' or above, but the current NuGet version is '2.7.40906.75'.
When I tell TeamCity to use 2.8.1 I get this error:
[12:38:13][install] Starting NuGet.exe 2.8.50320.36 from D:\BuildAgent\tools\NuGet.CommandLine.2.8.1.nupkg\tools\NuGet.exe
[12:38:13][install] Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from assembly 'mscorlib, Version=184.108.40.206, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
I've commented on this nuget issue: