从TFS2008 Team Build运行VS2010 UnitTests项目

我有一个Visual Studio 2010 MVC 3应用程序,其中包含单元测试项目。我有一个TFS 2008构建定义来构建解决方案。 在构建代理上,我已经安装了以下内容 VS2008团队系统开发人员版 VS2010专业版安装 我已将tfsservice.exe.config中的msbuildpath更新为.NET 4 farmework 删除了所有工作区 已按照http://blog.aggregatedintelligence.com/2011/03/vs2010-tfs-2008-and-unit-tests.html上的所有步骤进行操作 但是当我运行构建时,我收到以下错误: -
Using "TestToolsTask" task from assembly "c:Program FilesMicrosoft Visual Studio 10.0Common7IDEPrivateAssembliesMicrosoft.TeamFoundation.Build.ProcessComponents.dll".
    Task "TestToolsTask"
      C:Program FilesMicrosoft Visual Studio 10.0Common7IDEMSTest.exe /nologo /usestderr /searchpathroot:"c:TFSCoreCrimeBinariesRelease" /resultsfileroot:"c:TFSCoreCrimeTestResults" /testcontainer:"c:TFSCoreCrimeBinariesRelease\Project1.UnitTests.dll" /testcontainer:"c:TFSCoreCrimeBinariesRelease\Project2.UnitTests.dll" /testcontainer:"c:TFSCoreCrimeBinariesRelease\Project3.UnitTests.dll" /testcontainer:"c:TFSCoreCrimeBinariesRelease\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 FilesMSBuildMicrosoftVisualStudioTeamBuildMicrosoft.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 FilesMSBuildMicrosoftVisualStudioTeamBuildMicrosoft.TeamFoundation.Build.targets(1406,5): warning MSB4018: The "TestToolsTask" task failed unexpectedly. [c:TFSCoreCrimeBuildTypeTFSBuild.proj]
    C:Program FilesMSBuildMicrosoftVisualStudioTeamBuildMicrosoft.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命令而没有开关,它可以正常工作。我不明白为什么它试图添加这些开关。任何的想法?     
已邀请:
您需要安装VS 2010 Premium或Ultimate才能在MSTest.exe中使用这些开关。您可以通过使用所需的开关执行MSTest的Exec来解决这种问题,但是您不会在构建中看到结果。     
添加了开关,因为MSTest正在尝试将测试结果发布到服务器,以便您可以在团队构建资源管理器中的构建日志中以及用于报告的多维数据集中查看信息等。 假设您在安装VS2010 Professional时安装了Team Explorer 2010,您应该能够发布测试结果(除非许可需要溢价或最终 - 我不记得了)。可能值得重新安装并重新应用Service Pack以查看是否可以解决问题。     
我的dll-path中有空格问题。引号不起作用(可能是因为我错过了一些明显的东西?)。我没有在机器上安装VS.     

要回复问题请先登录注册