static void

TeamCity MsTest

Published Wednesday 8 August 2018

When you create a TeamCity Build Server, you install the Build Tools for Visual Studio rather than a full ($$) version of Visual Studio. That contains enough to build, but not to test. TeamCity has VSTest and MSTest drivers built in, but they won't find a suitable agent (the message is "teamcity.dotnet.vstest.15.0 defined in Build step: Run Tests")

From the Visual Studio Downloads / Tools download the "Agents for Visual Studio 2017", type "agent", and install. This puts MsTest on the server (in C:\Program Files (x86)\Microsoft Visual Studio\2017\TestAgent\Common7\IDE )

Next, configure the team city agent to tell it where to find MsTest. The instructions don't explain what you actually have to do. In the TeamCity install directory, open the buildAgent\conf folder. Edit the file and add the line teamcity.dotnet.mstest.15.0=C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\TestAgent\\Common7\\IDE\\MsTest.exe. The escaped slashes are needed as this is a java properties file.

Previously: VS2017 Unit Tests (22 February 2017)