0

我有一个试图从 Hudson CI 运行的 msbuild 文件。它像这样输出

"C:\Program Files\Gubka Bob\PartCover .NET 2\PartCover.exe" --target "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\MSTest.exe" --target-args "/noisolation " "/testcontainer:C:\CI\Hudson\jobs\Video Raffle\workspace\Source\VideoRaffleCaller\Source\VideoRaffleCaller.Test.Unit\bin\Debug\VideoRaffleCaller.Test.Unit.dll" --include "[VideoRaffleCaller* ]*" --输出 "Coverage\partcover.xml"

我收到这个错误

无效的开关“raffle\workspace\source\videorafflecaller\source\videorafflecall er.test.unit\bin\debug\videorafflecaller.test.unit.dll”。对于开关语法,键入“MSTest /help”

怎么回事?看起来 PartCover 不能很好地处理 --target-args 中的空格。还是我在某处遗漏了一些引号?有没有人喜欢工作?

4

1 回答 1

1

您忘记引用路径是完全正确的。阅读有关如何将 PartCover 与 MSBuild 集成的指南

--target-args=
Argument specifies arguments for target process. If target argument 
contains spaces - quote . If you want specify quote (") in , then 
precede it by slash (\)

所以尝试将您的 testcontainer 参数更改为

"/testcontainer:\"C:\CI\Hudson\jobs\Video Raffle\workspace\Source\VideoRaffleCaller\Source\VideoRaffleCaller.Test.Unit\bin\Debug\VideoRaffleCaller.Test.Unit.dll\""

于 2010-06-10T20:11:14.820 回答