When I run the Release build of my (VS 2008 .NET) unit tests, I get the following exception:
System.IO.FileLoadException: Could not load file or assembly ‘arcVegaORM, Version=1.0.3856.24327, Culture=neutral, PublicKeyToken=0dd85ae1d99ddbee’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040).
I do not get the exception when I run the debug build tests.
The unit test framework is copying an old version of the ‘arcVegaORM’ assembly into the TestResults\Out folder. I do not know where it gets the old version from – it does not match the version in the projects bin\Release folder.
I am beginning to think there is a bug with the VS.NET unit test framework, and that it has the old version cached.
I have now found a post on the MSDN Forums – it seems to be a bug:
http://social.msdn.microsoft.com/Forums/en-US/vststest/thread/af530ba8-1299-4113-a5fe-4f6b009fa599
!! If I turn off code coverage, then the tests run fine !!