Finally....we fixed it.
I had to take the following steps on the Build Server:
- Installed VS2015 Update 2
- Edit the Environment Variable "PATH" to change one setting from C:\Program Files (x86)\MSBuild\12.0\Bin\; to C:\Program Files (x86)\MSBuild\14.0\Bin\;
- Since we use TeamCity to fire off a PowerShell script that in turn fires off the MSBuild. I updated the PowerShell module PSAKE from 4.2 to 4.6 (but this might not have been necessary)
- Created a new Environment Variable "MSBuildEmitSolution" and gave that a value of "1"
- Copied the file "Microsoft.Build.Tasks.v12.0.dll" from "C:\Program Files (x86)\MSBuild\12.0\Bin\amd64" to "C:\Program Files (x86)\MSBuild\14.0\Bin\amd64". No idea why this was reported as an error in our BUILD log because it's not an AMD machine...
- Using NUGET, had to add the package "Microsoft.Net.Compilers" to every C# project that used C#6 syntax (basically, all of them)
Not all of the above steps may be strictly necessary, but I would suggest that certainly steps 1. and 5. were definitely required.
HTH
Griff