java.lang.IllegalArgumentException : mstest.exe cannot be found

Still need help?

The Atlassian Community is here for you.

Ask the community


MSTest 2012 can not be used as an executable. The build fails with the following exception:

java.lang.IllegalArgumentException: mstest.exe cannot be found
at com.atlassian.bamboo.plugin.dotnet.tests.mstest.MSTestRunnerTaskType.execute(
at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(
at com.atlassian.bamboo.task.TaskExecutorImpl.execute(
at Source)


Make sure that Bamboo is running  as "Administrator" and not as "SYSTEM". Also, double check the path and other settings following the guidelines in this document: MSTest Runner.

Based on our research and checking through the source for the Bamboo .net plugin, it appears that the MSTest unlike other executables like the NUnit Runner and the MSBuild, can not be set as a capability. The MsTest capability is derived from the Visual Studio IDE itself. There is an option to use the MSBUILD outside of the Visual studio or if possible use Nunit Runner if an option. (Workaround ex. : Defining an msbuild target and running the mstest using a msbuild task.)

In case it's running on an agent, you need to create the file file in the <bamboo-agent-home>/bin directory and populate the file with the following:

system.builder.devenv.Visual+Studio+2012=C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE

The remote agent should be restarted for the capability to be picked up. Please replace the PATH as appropriate.

Last modified on Nov 2, 2018

Was this helpful?

Provide feedback about this article
Powered by Confluence and Scroll Viewport.