2

We are using TFS 2010 to build our solutions and run unit tests (MSTest). Everything used to work fine and our builds succeeded when all unit tests passed.

However, after updating our test projects to .Net 4, all builds fail with error message 'Results file does not exist. Publish failed'. This occurs even though all tests pass.

We have tried installing http://support.microsoft.com/kb/983504 to no avail.

Running MSTest with diagnostic logging creates a huge file, but the log contains no error message. The only line I find slightly interesting is

TestFormatsConverter.LoadAsCurrentVersion: <path_to_build>\TestResults\tfsservice_<service> 2012-03-28 09_51_49_Any CPU_Debug.trx is already the current file format.

Our old solutions, which have not been updated, still succeeds.

Update

After observing the build folders on the build machine during a build, I noticed that the .trx file for the failing solutions are not created in the TestResults folder. For the old solutions, the file is created. Is there any reason why upgrading to .Net 4 might cause the .trx file not being created?

sorteberg
  • 51
  • 6

1 Answers1

3

So it turns out there was a solution to this problem after all!

What actually happens is that MSTest is run twice; once with MSTest 10 and once with MSTest 9. The first run covers all of our .Net 4 test projects and creates and publishes the test results like it is supposed to.

However, our source also contains a .Net 2 assembly named Microsoft.Reactive.Testing.dll, which is included in the newest (.Net 4) installer for Reactive Framework (1.0.10621). MSTest 10 cannot run .Net 2 tests, so another test run is started.

Unfortunately, Microsoft.Reactive.Testing.dll is only included in the test run because it contains "test" in its name. It does not actually contain any unit tests. Thus, no tests are run, no results file is created, and no results file can be published.

The solution is simple: exchange the .Net 2 version of Microsoft.Reactive.Testing.dll with a .Net 4 version. This can be downloaded using NuGet.

sorteberg
  • 51
  • 6