chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
0 votes

Sorry that my company policy doesn't allow me to post any code block in this questions so I have to try explaining the problem by words.

I'm trying to create unit test for a legacy classes that contains 50 static variables.

As you could imagine that the static variables are dirty after being tested and i came up with a solution for creating new appdomain for every test. That involved "AppDomain.CreateDomain" and "domain.CreateInstanceFromAndUnwrap"

Those test works perfectly on Resharper test runner and nunit test runner

But the Typemock test running all return failed with exception

System.IO.FileNotFoundException : Could not load file or assembly 'TypeMock, Version=, Culture=neutral, PublicKeyToken=3dae460033b8d8e2' or one of its dependencies. The system cannot find the file specified.

Again, sorry that I cannot post any code block over here. So, please let me know if anything is not clear about my problem.


asked by cscmh99 (6.1k points)

1 Answer

0 votes


To analyze the FileNotFoundException  please use fusion log:


Or, you can reinitialize the class setup by manually calling static constructors with : Isolate.Invoke.StaticConstructor(typeof(<type>));

in the begining of every test (or TestInitialize).

Let me know if it helped.

answered by alex (17k points)