views:

73

answers:

1

Setting up TeamCity 5.0.1 to run unit tests for the first time, we're seeing this error:

Test(s) failed. System.IO.FileNotFoundException : Could not load file or assembly 'Moq, Version=3.1.416.3, Culture=neutral, PublicKeyToken=69f491c39445e920' or one of its dependencies. The system cannot find the file specified.

We're using version 3.1.416.3 of Moq, the dll of which has a file version of 3.1.0.0

The reference in our project file looks like this:

<Reference Include="Moq, Version=3.1.416.3, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
  <SpecificVersion>False</SpecificVersion>
  <HintPath>..\..\..\lib\binaries\thirdparty\Moq.dll</HintPath>
</Reference>

We're able to run our unit tests in Visual Studion with ReSharper, and also from the nunit GUI (both on our developer machines and the build server in question).

What's going on here?

+1  A: 

Not a 100% answer, but a workaround:

You can remove the explicit version-number in the build-file. Since it's anyway provided by your project and only used for the tests. Just change the 'Moq, Version=3.1.416.3, ...' part to 'Moq'. Then the version of the hint-path is used.

Gamlor