views:

422

answers:

2

I've just setup TFS 2010 Beta 2 on our server and it's running fine. I've checked-in my solution which is written in Visual Studio 2008 SP1, with a main Class project and Unit test project. Source control is working fine with the forward compatibility patch for VS 2008 Team explorer to work with TFS 2010.

The unit tests are written using MSTest. It all works and runs locally with tests passing, but when I've setup the automated build on the server to build the solution, the main class project builds but the unit tests fail.

Client: Windows 7 64-bit, Visual Studio 2008 SP1 Server: Windows 2008 RS 64-bit, Team Foundation Server 2010 Beta 2

I've tried different targets, different .net versions. With the last attempt using the following MSTest version C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe I get the following error

TFB210610: 'MSTest.exe' returned an unexpected exit code. Expected '0'; actual '1'.

This leads me to think the tests are failing, but locally they are not.

Has anyone else had any issues with this? And can point me in the right direction?

Cheers

Edit

I now get the following error ...

C:\Windows\Microsoft.NET\Framework64\v3.5\Microsoft.Common.targets: Could not resolve this reference. Could not locate the assembly "Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

A: 

Run mstest.exe directly from a command line on the server like this:

mstest.exe /testcontainer:myunittests.dll

That should give you some more information about what is going wrong.

Wim Coenen
Thanks for the pointer, however there is no access to a Visual Studio command prompt on the server to allow to do this. I'm starting to hedge towards having to install an SDK on the server, however I don't want to install the whole of Visual Studio ... any ideas?
WestDiscGolf
A regular command prompt will do, although you might have to give the full path to mstest.exe
Wim Coenen
A: 

Workaround

I've managed to get it pretty much working. It involved not using ExpectedException test attributes and registering a version 9 of the dll into the gac on the server. This will do for now, hopefully it will be resolved in the full 2010 release, altho I will also be able to fully upgrade TFS and VS, so all will be good.

A bit more detailed write up can be found here

:-)

WestDiscGolf