Could not load type ‘Castle.MonoRail.TestSupport.BaseControllerTest’

Just thought I would post this as a reference for anyone else who gets the same problem. I had a bunch of integration tests that were running fine and using Monorail’s BaseControllerTest when all of a sudden I get:

Could not load type 'Castle.MonoRail.TestSupport.BaseControllerTest' from assembly 'Castle.MonoRail.TestSupport, Version=1.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc'.
System.TypeLoadException: Could not load type 'Castle.MonoRail.TestSupport.BaseControllerTest' from assembly 'Castle.MonoRail.TestSupport, Version=1.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc'. ...

This seem to be caused by upgrading my project to use newer versions of the  Castle.MonoRail.TestSupport assembly. Luckily I found a post that helped me resolve the issue on the Castle forum. http://forum.castleproject.org/viewtopic.php?t=3352. The cause of the problem was that an older version of the Castle.MonoRail.TestSupport.dll was registered in my GAC.

To resolve the problem (on Vista) open the VS 2008 command prompt as admin and run:

gacutil /u castle.monorail.testsupport

This will uninstall the Castle.MonoRail.TestSupport.dll from your GAC, re-build your project and your tests should now run!

Advertisements

~ by Tim on 2 August 2008.

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 )

Google+ photo

You are commenting using your Google+ 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 )

w

Connecting to %s

 
%d bloggers like this: