I recently installed TFS 2017 Express on my Windows 10 Pro PC. I also have Visual Studio 2017 Pro installed on the same machine. When trying to build a solution on TFS, I noticed a persistent behavior. If my solution includes a unit test project, the build process fails at the "Visual Studio Build" step. If I remove the unit test project, commit to TFS, and queue a new build, the build succeeds.
I made sure to indicate "Visual Studio 2017" in the Nuget and Visual Studio build steps and "latest" in the Test build step.
These are the relevant excerpts from the log:
- (Warning) Visual Studio version '15.0' not found. Looking for the latest version.
- (Error) HelloConsole\packages\Microsoft.Net.Compilers.2.1.0\build\Microsoft.Net.Compilers.props (13, 5) HelloConsole\packages\Microsoft.Net.Compilers.2.1.0\build\Microsoft.Net.Compilers.props(13,5): Error : Microsoft.Net.Compilers is only supported on MSBuild v14.0 and above
- (Error) Process 'msbuild.exe' exited with code '1'.
I would include any other logs or screenshots if that would help diagnose the issue.
This symptom only happens when a C# unit test project is present. Are there any workarounds so that I can run TFS builds with a C# unit test project in the solution?
I did look at the available documentation and see nothing helpful in this scenario. I drilled through that document and looked into MSBuild Command-Line Reference, thinking I could direct Visual Studio Build to use MSBuild version 15. All I found under "version" was /version: Display version information only. The project isn’t built.
Update: I see that there are two different ways to download TFS Express. The way I downloaded it had no mention of version. I downloaded it from here and scrolled to "Team Foundation Server Express" and clicked "Download". There was no mention of a version, as indicated by @PatrickLu-MSFT.