
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
3 comments
This is of NO USE….
Vaibhav
for my case, even in the ‘Debug’ mode test method does not run successfully and same error is thrown. i tried ur advice but it seems not working here
pratap
I had similar problem while running my application in a system that had no Directx runtime. I downloaded and installed directx_aug2008_redist.exe. Then it was all fine. Hope this helps someone of you.
Maverickcoder