blog community

Welcome to blog community Sign in | Join | Help
in Search

Raimond Brookman

Architecture and .NET Development

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

Published Monday, November 06, 2006 10:18 AM by Raimondb

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

Vaibhav said:

This is of NO USE....

February 8, 2008 10:30 PM
 

pratap said:

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

April 10, 2008 11:58 AM

Leave a Comment

(required) 
(optional)
(required) 
Submit

This Blog

Syndication

News

Subscribe in NewsGator Online

Subscribe in Bloglines

Add to Google


 Visitors since June 2005




Powered by Community Server, by Telligent Systems