views:

23

answers:

0

We have a subset of unit tests which until recently have always been run through Visual Studio. I am now working on a continuous integration setup which will run the tests. All of the tests pass when run through Visual Studio but when I attempt to run them from the command line using mstest they fail with a "TypeInitializationException" which says that it cannot find the dll file for the type.

System.TypeInitializationException: The type initializer for foo.bar_Accessor' threw an exception. 
--->  System.IO.FileNotFoundException: Could not load file or assembly 'foo, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. 
The system cannot find the file specified.Assembly manager loaded from: 
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll

The dll in question is a project reference in the unit test project. There is also a test reference which creates foo.bar_Accesor version of the class.

I've noticed that when the tests are run through visual studio a "Coverage _timestamp" folder is created which contains an IN and an OUT folder. The OUT folder contains, among other things, foo.dll and foo_accesor.dll.

When the tests are run from the command line a "username _timestamp" folder is created which contains only an OUT folder. The OUT folder contains, among other things, foo_accesor.dll but not foo.dll which is the one mentioned in the error message.