1
votes

I'm getting a dumb exception on nunit.exe launch attempt:

System.IO.FileNotFoundException: Could not load file or assembly 'nunit.framework, Version=2.5.5.10112, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77' or one of its dependencies. The system cannot find the file specified.

i.imgur.com/jSm73.png

The version of NUnit is 2.5.9, installed from MSI package, i.e. different versions! Putting the library into executable's root didn't helped. (The same error for 2.5.5).

How can it be??

3
Can I confirm Google has not turned up anything useful? - leppie
Also, why is your dialog and 'paste' showing different version numbers? Perhaps you should just clean up all the installed versions of nunit. - leppie
@leppie: Thanks! Corrected. Was pasting exception text from google - abatishchev
@leppie: I had no NUnit installed before I installed 2.5.9 firstly and nunit.exe always throws exception about 2.5.5 - abatishchev
@abatishchev: You will have ask the author's that. I would look at the references via Reflector or ILDASM. - leppie

3 Answers

3
votes

The NUnit app loads NUnit frameworks dynamically, thus looking at the statically referenced assemblies is not of much help.

Using the Assembly Binding Log Viewer could provide more detailed information on what assemblies are requesting the 2.5.5 assembly.

Update: just traced all assembly bindings done by NUnit 2.5.9 using the log viewer. With no test assemblies immediately loaded, the nunit.framework assembly is never loaded. Nunit core assemblies are loaded ofcourse, but only 2.5.9 versions.

1
votes

Can it be that it is trying to automatically load a test assembly that was compiled with NUnit 2.5.5?

In that case, I would rather put the missing NUnit dll alonside the test assembly, instead of the NUnit runner. (By making it a part of the build process. In VisualStudio set the CopyLocal property to true for the NUnit.Framework assembly reference, if you are using VS, i.e.)

1
votes

I had this problem, when I had "Copy Local" to true and nunit referenced to a static path. When I updated nunit, I updated the dll in the path, but in the actual project file (csproj), it still had the reference include Version as the old version. Manually removing it and then re-adding it, fixed it.