从MSBuild运行单元测试时出错 [英] Error when running unit tests from MSBuild
问题描述
我有一个在构建服务器上运行的MS Build脚本,然后运行单元测试(将runtests设置为true).
I have an MS Build script that runs on the build server and then runs unit tests (have runtests set to true).
调用MSTest时出现以下错误.有人建议安装Visual Studio 2010测试版和Team Explorer2010.这样做之后仍然出现相同的错误.似乎我需要特定版本的MSTest才能发布到TFS.
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.
有什么想法吗?
===========================================================
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.
===========================================================
推荐答案
尝试安装VS2010 Premium或Ultimate,其中包括MSTest版本,该版本支持用于发布测试结果的开关.另请参见运行VS2012单元测试或
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.
这篇关于从MSBuild运行单元测试时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!