0
votes

When running NUnit unit tests within Resharper, I'm getting the following error:

SetUp method failed. SetUp : System.IO.FileNotFoundException : Could not 
load file or assembly 'Microsoft.Practices.Unity, Version=2.0.414.0, 
Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. 
The system cannot find the file specified.

If I then "Re-run the failed unit test" they complete (albeit this may take many times of re-runs). Appears to be since I upgraded to Resharper v8 from v7.

Running any of the multiple applications that we are unit testing does not show this error. We are using the ServiceLocator pattern throughout our code.

2

2 Answers

1
votes

I appear to have fixed this within the Resharper settings, forcing each assembly to have its own AppDomain whilst running tests. See the third checkbox option down under Resharper -> Options -> Tools -> Unit Testing.

Screenshot of Resharper Unit Test option for separate AppDomains

0
votes

You should check that you used the first version of unity in the main project, because must match to test project and your main project in the meantime you must check all unity dll's.