I've got a C# .NET class library MyClassLibrary that compiles fine. I'm trying to create a unit test project for it (using Visual Studio Unit Testing Framework, with Visual Studio 2010). The class library does have big classes in it, but whenever I run even the simplest test against the simplest class, I get the following exception:
Test method MyClassLibraryTest.MyClassLibraryTests.MySimpleClassTest threw exception:
System.TypeLoadException: Could not load type 'MyClassLibrary.MySimpleClass' from assembly 'MyClassLibrary, Version=22.214.171.124, Culture=neutral, PublicKeyToken=null'.
The MyClassLibrary assembly was set to x86 mode in the configuration manager. Changing this to x64 fixed it. I really wish Visual Studio would detect this and report it as a less obscure error.