vlad
vlad

Reputation: 4778

VS2010 unit tests fail on TFS 2008 build server

The problem is similar to the one described here, but I have yet to find a solution.

Setup:

Running and publishing unit tests using this setup worked. We now want to upgrade to VS2010, without upgrading TFS.

I upgraded the solution to .NET 4.0, set every project's target framework to .NET 4, installed the .NET framework 4.0 on the TFS build server and edited the MSBuildPath value in TfsBuildService.exe.config to point to the 4.0 version of msbuild. After changing the build file's ToolsVersion to 4.0, the builds worked, but the builds would not run any tests (obviously, since VS2010 wasn't installed at this point).

After installing VS2010 Professional, however, all builds stopped working. I got them working again after recreating the build definitions, but even after installing Team Explorer 2010, the tests aren't running as mstest is complaining about invalid switches passed to it. The message from the log is below:

The "TestToolsTask" task is using "MSTest.exe" from "E:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe".
  Invalid switch "/publish".
  Invalid switch "/publishbuild".
  Invalid switch "/teamproject".
  Invalid switch "/platform".
  Invalid switch "/flavor".

I thought installing Team Explorer 2010 was supposed to take care of this. Has anyone encountered this before, and fixed it? If so, how?

Upvotes: 1

Views: 472

Answers (1)

Buck Hodges
Buck Hodges

Reputation: 3352

You'll need to install Visual Studio 2010 Premium or Ultimate on the build server to get those options to work. The edition of mstest in VS Pro does not have them.

Buck

Upvotes: 1

Related Questions