Solving System.Reflection.ReflectionTypeLoadException with VSTS Unit Testing
Recently VSTS kept throwing the following exception at me
Unit Test Adapter threw exception: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information..
The weird thing was that debugging a test would work, but simply running it would not.
After some searching it turned out that a drive containing the external assembly which it complained about was not available, although compilation did just work.. probably because of copy-local.
I experimented some more and found that the easiest way to detect the assembly is to first perform a "Clean solution" in Visual Studio and then perform a "Rebuild All". This way, all dependencies wil be re-checked with compilation, and the compiler will simply complain about the missing assembly. Of course you could also use fuslogvw.exe, but I think this solution is often easier.
[Update 11-04-2008]: I found that when the above does not works, switching to Debug mode, Running tests and switching back to relase mode can help