We are using nant to run all of our builds, and using the NUnit2 for testing. Just to help out, nant has a task called nunit2.
Unfortunately, every time I ran our build I would recieve this error:
[loadtasks] Failure scanning "C:\Program Files\nant-0.85\nant-0.85\bin\NAnt.NUnit2Tasks.dll" for extensions. Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.That could have been a bit more helpful.
Fortunatly Reflector was able to save the day. I was able to find the NAnt.NUnit2Tasks.dll on my file system (not to hard, the error message told me right where to find it), and loaded it into Reflector.
From there I checked the references of the dll. Two caught my eye. nunit.core and nunit.util. Still using resharper I tried to expand the references...Resharper could not find them. And they did not exist in the same directory as NAnt.NUnit2Tasks.dll. That meant that nant was looking for them in the GAC and they were not there!
A quick little script proved that to be true. It looked like this:
gacutil.exe /l nunit.util
I received this message:
The Global Assembly Cache contains the following assemblies:OK, enough debugging, I ran the following two scripts to put those two dlls in the GAC and everything worked fine:
Number of items = 0
C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin>gacutil.exe /i "C:\Program Files\NUnit-Net-2.0 2.2.8\bin\nunit.core.dll"
C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin>gacutil.exe /i "C:\Program Files\NUnit-Net-2.0 2.2.8\bin\nunit.util.dll"
No thanks Google, I'll just fix it myself thank you very much.