Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
861 views
in Technique[技术] by (71.8m points)

visual studio 2010 - Running VS2010 UnitTests project from TFS2008 Team Build

I have a Visual Studio 2010 MVC 3 application with unit tests projects in it. I have a TFS 2008 build definition to build the solution.

On the build agent i have got following installed

But when i run the build I get the following error:-

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'.

If I run the mstest command directly on the build server via commandline without the switches it works fine. I don't understand why its trying to add these switches. any idea?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You need VS 2010 Premium or Ultimate installed to use those switches in MSTest.exe. You can get around this sort of by just doing an Exec of MSTest with the switches you want, but then you won't see the results as nicely in your build.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...