문제

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

도움이 되었습니까?

해결책

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

다른 팁

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.

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top