我有一个 Visual Studio 2010 MVC 3 应用程序,其中包含单元测试项目。我有一个 TFS 2008 构建定义来构建该解决方案。
在构建代理上,我安装了以下内容:
- VS2008 团队系统开发人员版 - 安装了 VS2010 Professional - 我已将 tfsservice.exe.config 中的 msbuildpath 更新为 .NET 4 框架 - 删除了所有工作区 - 已按照 http://blog.aggregatedintelligence.com/2011/03/vs2010-tfs-2008-and-unit-tests.html 中的所有步骤进行操作
但是当我运行构建时,我收到以下错误:
如果我直接在构建服务器上通过命令行运行mstest命令而不使用开关,它可以正常工作。我不明白为什么它会尝试添加这些开关。有任何想法吗?
在构建代理上,我安装了以下内容:
- VS2008 团队系统开发人员版 - 安装了 VS2010 Professional - 我已将 tfsservice.exe.config 中的 msbuildpath 更新为 .NET 4 框架 - 删除了所有工作区 - 已按照 http://blog.aggregatedintelligence.com/2011/03/vs2010-tfs-2008-and-unit-tests.html 中的所有步骤进行操作
但是当我运行构建时,我收到以下错误:
Using "TestToolsTask" task from assembly "c:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\Microsoft.TeamFoundation.Build.ProcessComponents.dll".
Task "TestToolsTask"
C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe /nologo /usestderr /searchpathroot:"c:\TFS\Core\Crime\Binaries\Release" /resultsfileroot:"c:\TFS\Core\Crime\TestResults" /testcontainer:"c:\TFS\Core\Crime\Binaries\Release\\Project1.UnitTests.dll" /testcontainer:"c:\TFS\Core\Crime\Binaries\Release\\Project2.UnitTests.dll" /testcontainer:"c:\TFS\Core\Crime\Binaries\Release\\Project3.UnitTests.dll" /testcontainer:"c:\TFS\Core\Crime\Binaries\Release\\Project4.UnitTests.dll" /publish:"http://server:8080/" /publishbuild:"vstfs:///Build/Build/88124" /teamproject:"Core" /platform:"Any CPU" /flavor:"Release"
Invalid switch "/publish".
Invalid switch "/publishbuild".
Invalid switch "/teamproject".
Invalid switch "/platform".
Invalid switch "/flavor".
For switch syntax, type "MSTest /help"
C:\Program Files\MSBuild\Microsoft\VisualStudio\TeamBuild\Microsoft.TeamFoundation.Build.targets(1406,5,1406,5): warning : TF270015: 'MSTest.exe' returned an unexpected exit code. Expected '0'; actual '1'.
The previous error was converted to a warning because the task was called with ContinueOnError=true.
C:\Program Files\MSBuild\Microsoft\VisualStudio\TeamBuild\Microsoft.TeamFoundation.Build.targets(1406,5): warning MSB4018: The "TestToolsTask" task failed unexpectedly. [c:\TFS\Core\Crime\BuildType\TFSBuild.proj]
C:\Program Files\MSBuild\Microsoft\VisualStudio\TeamBuild\Microsoft.TeamFoundation.Build.targets(1406,5): warning MSB4018: Microsoft.TeamFoundation.Build.Workflow.Activities.UnexpectedExitCodeException: TF270015: 'MSTest.exe' returned an unexpected exit code. Expected '0'; actual '1'.
如果我直接在构建服务器上通过命令行运行mstest命令而不使用开关,它可以正常工作。我不明白为什么它会尝试添加这些开关。有任何想法吗?