Question

I have a .NET 3.5 assembly covered by around 4000 MbUnit tests. I hve been running these using the mbunit.cons.exe program with no trouble.

Now I am trying to switch to Gallio (mbunit.cons.exe started blowing up with an 'out of memory' exception when producing the XML report).

When running the tests in Icarus, most of them fail with the following exception:

System.TypeInitializationException: The type initializer for 'Rhino.Mocks.MockRepository' threw an exception. --->
System.IO.FileLoadException: Could not load file or assembly 'Castle.DynamicProxy2, Version=2.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc' or one of its dependencies.
The located assembly's manifest definition does not match the assembly reference.
(Exception from HRESULT: 0x80131040) at Rhino.Mocks.MockRepository..cctor()

The assembly under test does use dynamic proxy. The dynamic proxy assembly is in the same directory as the assembly under test.

I have tried putting the directory containing the assemblies in the 'hint directories', 'application base directory' and 'working directory' fields in Icarus, but this does not alter the result.

Has anyone successfully used Gallio and Dynamic Proxy together, or have any hints as to what the problem could be?

Was it helpful?

Solution

Looks like Rhino.Mocks references a different version of Castle.DynamicProxy2. It tries to look for 'Castle.DynamicProxy2, Version=2.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc'. Can you have a look at the Castle.DynamicProxy2 assembly in your bin folder and see if it has the same version and PubliKeyToken?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top