1

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??

abatishchev
  • 98,240
  • 88
  • 296
  • 433
  • Can I confirm Google has not turned up anything useful? – leppie Jan 23 '11 at 19:35
  • Also, why is your dialog and 'paste' showing different version numbers? Perhaps you should just clean up all the installed versions of nunit. – leppie Jan 23 '11 at 19:36
  • @leppie: Thanks! Corrected. Was pasting exception text from google – abatishchev Jan 23 '11 at 19:40
  • @leppie: I had no NUnit installed before I installed 2.5.9 firstly and nunit.exe always throws exception about 2.5.5 – abatishchev Jan 23 '11 at 19:42
  • @leppie: Google finds [nothing](http://www.google.com/search?q=System.IO.FileNotFoundException+Could+not+load+file+or+assembly+nunit.framework+version%3D2.5.5.10112) interesting – abatishchev Jan 23 '11 at 19:43
  • verify the assembly version, if correct, just GAC the damn thing :) – leppie Jan 23 '11 at 19:45
  • @leppie: My main question is why does NUnit 2.5.8 requires lib 2.5.5. Is it well-known bug or some my misconfiguration? – abatishchev Jan 23 '11 at 19:50
  • 1
    @abatishchev: You will have ask the author's that. I would look at the references via Reflector or ILDASM. – leppie Jan 23 '11 at 19:51
  • @leppie: Reflector says that `nunit.exe` has no references/dependencies to `nunit.framework`, anything else `nunit.*` but not `nunit.framework` – abatishchev Jan 23 '11 at 19:57
  • Dumb or not, I can't take back rep earned by people taking the time to help you solve your problem. –  Jan 25 '11 at 13:59
  • @Will: Does deletion of a question take back rep? IF yes, of course, nothing should be deleted. But I thought that does not – abatishchev Jan 25 '11 at 14:20
  • @abat I'm 80% sure a recalc would remove the rep from a deleted answer. –  Jan 25 '11 at 17:36

3 Answers3

3

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.

Peter Lillevold
  • 33,668
  • 7
  • 97
  • 131
  • I found no records in Fusion Log about `NUnit.Framework.dll` on the error occurring. I think that's because `FileNotFoundException` occurs, not `TypeLoadException` – abatishchev Jan 24 '11 at 19:40
1

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.

James John McGuire 'Jahmic'
  • 11,728
  • 11
  • 67
  • 78
1

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.)

Pete
  • 12,206
  • 8
  • 54
  • 70
  • I have no NUnit.Framework.dll ver. 2.5.5 on my computer at all. I deleted everything possible – abatishchev Jan 24 '11 at 18:49
  • But that is not what I suggest, I suggest that NUnit is trying to load a test assembly (i.e. an assembly containing unit tests) that was linked with NUnit 2.5.5? – Pete Jan 24 '11 at 19:30
  • 1
    You know but that's a mystic. I retargeted to 2.5.9 and recompiled all my test projects several times but Reflector was indicating that the still targeted to the old version. Deletion of everything helped. Thanks! – abatishchev Jan 24 '11 at 19:41