A project that compiles locally (targeting .NET Framework 4.6.1) fails on TeamCity with the following message:
[CoreCompile] Csc [Csc] Using shared compilation with compiler from directory: C:\Program Files (x86)\MSBuild\14.0\bin
[19:02:15][Csc] Services\MyFile.cs(20, 55): error CS1525: Invalid expression term 'int'
[19:02:15][Csc] Services\MyFile.cs(20, 59): error CS1003: Syntax error, ',' expected
I also get a lot of these in the failed compile in red writing:
[Step 5/9] The target "MvcBuildViews" listed in a BeforeTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.Publishing.targets (845,131)" does not exist in the project, and will be ignored.