Koen about .Net

October 27, 2009

Unit Test Adapter threw exception: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

Filed under: Development — Tags: , — koenwillemse @ 10:36

I’ve been banging my head on this error for the last hour. I tried to run a set of unittests from the project we’re currently working on. The tests worked fine.
Then I took my shelveset and for some reason the tests didn’t execute anymore and all gave the error message “Unit Test Adapter threw exception: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.”. What???

First I tried all the default actions for trying to resolve problems with running tests:
1. Clean the solution
2. Complete rebuild of the solution
3. Refresh the Test View window.
4. Closing Visual Studio and reopening the solution

Unfortunately, none of these actions had the desired effect.

Eventually I was comparing all changes made to the code in source control. What I noticed was a difference in the solution file. The following three lines were missing:

GlobalSection(TestCaseManagementSettings) = postSolution
    CategoryFile = Solution.vsmdi
EndGlobalSection

I added these lines again and it worked :-).

Those vsmdi files are driving me crazy sometimes. Haven’t used them for anything yet and got a lot problems of them when building and running tests (for a while Visual Studio kept adding them; at one point I had 20 vsmdi files in my solution directory).

But to make the story short, I can run the tests again and it had to do with something missing in the solution file.

Advertisements

2 Comments »

  1. […] types. Retrieve the LoaderExceptions property for more information. – Part 2 In a previous post I wrote about a problem I had with running unittests, which resulted in an exception with the […]

    Pingback by Unit Test Adapter threw exception: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. – Part 2 « Koen about .Net — January 7, 2011 @ 09:46

  2. Thanks a lot for posting this, my sln file some how missed the line for vsmdi and I wasted 4 hrs trying to solve that.

    Comment by Vijay — March 7, 2013 @ 01:54


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: