在为我的 Team Build 2010 执行 MSTest 工作流事件时,我收到下一个输出日志错误:
MSTest
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe /nologo /usestderr /testcontainer:"D:\TFS\Builds\MyProyect\Debug\W_DEBUG\W_DEBUG_20111214.15\Binary\OrderedTest1.orderedtest" /publish:"http://localhost:8080/tfs/DefaultCollection" /publishbuild:"vstfs:///Build/Build/2550" /teamproject:"MyProyect" /platform:"Mixed Platforms" /flavor:"Debug"
The directory name is invalid
如果我在本地构建服务器上执行该命令(用双引号括起来的 MSTest.exe 路径),它可以完美运行。
如何设置 MSTest 事件的绝对路径?我曾尝试将 MSTest ToolPath 属性设置为:
System.IO.Path.GetFullPath("C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\")
不成功。
提前致谢
最佳答案
我通过在构建定义中使用以下命令解决了这个问题:
<Exec Command=""%VS100COMNTOOLS%\..\IDE\MSTest.exe" /testcontainer:
以这种方式使用变量:
%VS100COMNTOOLS%
(或
%VS90COMNTOOLS%
对于 Visual Studio 2008)我不需要向构建服务器的 PATH 环境变量和 mstest.exe
添加任何内容。已成功解决。
关于visual-studio-2010 - MSTest 工作流事件执行错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8503269/