NUnit assembly not found

I had the same problem, and I had installed using NUnit-2.4.8-net-2.0.msi. Expanding on the "add to the GAC" comment, here's what I did:

  • Open your "Visual Studio command prompt (generally: make sure gacutil is in your path) and: cd "C:\Program Files\NUnit 2.4.8\bin"

  • Unregister your NUnit entries from the GAC. You can do this by finding the NUnit entries registered in the GAC:

    gacutil /l | find /i "nunit" > temp.bat && notepad temp.bat
    
  • Prepend the nunit.core and nunit.framework lines with "gacutil /uf", i.e.:

    gacutil /uf nunit.core,Version=2.4.2.0,Culture=neutral,PublicKeyToken=96d09a1eb7f44a77
    
    gacutil /uf  nunit.framework,Version=2.4.2.0,Culture=neutral,PublicKeyToken=96d09a1eb7f44a77
    
  • Run your .bat file to remove them: temp.bat

  • Register the NUnit DLL files you need:

    gacutil /i nunit.core.dll
    
    gacutil /i nunit.framework.dll
    

Make sure you have added a reference to nunit.framework. If you have, then make sure the properties of that reference have the copy local property set to true.

Tags:

Nunit