Error when running unit tests from MSBuild

柔情痞子 提交于 2019-12-12 04:28:31

问题


I have an MS Build script that runs on the build server and then runs unit tests (have runtests set to true).

I am getting the following errors when calling MSTest. Some people suggested installing Visual Studio 2010 Test Edition and Team Explorer 2010. After doing that am still getting the same errors. Seems I need a specific version of MSTest to be able to publish to TFS.

Any ideas?

===========================================================
The "TestToolsTask" task is using "MSTest.exe" from "C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe".
  Invalid switch "/publish".
  Invalid switch "/publishbuild".
  Invalid switch "/teamproject".
  Invalid switch "/platform".
  Invalid switch "/flavor".
  For switch syntax, type "MSTest /help"
MSBUILD : warning MSB6006: "MSTest.exe" exited with code 1.
===========================================================

回答1:


Try installing VS2010 Premium or Ultimate, these include a version of MSTest that supports the switches for publishing test results. See also Running VS2012 unit tests or Running VS2010 unit tests.



来源:https://stackoverflow.com/questions/6948094/error-when-running-unit-tests-from-msbuild

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!