NUnitAsp and NUnit 2.2 Don't Get Along
NUnit (well, NUnitAsp, actually) just ran me for a loop. I had not loaded this particular test project for a while (since I upgraded to NUnit 2.2), and when I tried to load it up, I got the following:
System.IO.FileNotFoundException: File or assembly name nunit.framework, or one of its dependencies, was not found.
Server stack trace:
at NUnit.Core.TestSuiteBuilder.Build(String assemblyName, Int32 assemblyKey)
at NUnit.Core.TestSuiteBuilder.Build(String projectName, IList assemblies)
at NUnit.Core.RemoteTestRunner.Load(String projectName, String assemblies)
at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(MethodBase mb, Object args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
Exception rethrown at :
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at NUnit.Core.TestRunner.Load(String projectName, String assemblies)
at NUnit.Util.TestDomain.Load(String testFileName, String appBase, String configFile, String binPath, String assemblies, String testFixture)
at NUnit.Util.TestDomain.Load(NUnitProject project, String testFixture)
at NUnit.Util.TestLoader.LoadTest(String testName)
Now, initially I thought it'd be something to do with my project references, even though that didn't really make sense, so I tried removing my nunit.framework reference and readding. No luck. But thanks to Google, I saw the words "NunitAsp" and thought, "aha! that must be it.. I'll just go get the latest version of NUnitAsp and install it."
No beans. Apparently the good folks developing that project haven't bothered to rebuild with the new version of NUnit. So, after pondering the problem for a minute, I decided to just go get an old version of NUnit and stick it in the GAC. After all, that's what it's for, right? Running multiple versions of the same product?
So I went to NUnit's site on sourceforge and blundered around a bit (I only go there to download stuff occassionally) and finally came back to NUnit.org, where they nicely offered the older (2.1) version for download as MSI or source.
Since I only wanted the framework DLL (and not another GUI et al), I downloaded the source zip first, hoping they included a built DLL (to save me the trouble of building it). Uh uh.. So I tried MSI.. nope, that won't install over a newer version.
SO, back to the source zip. Unzip, open in VS, build in Release mode, and then drag-n-drop the nunit.framework.dll to the GAC.
Joy, rapture, etc. etc., the old NUnit test project now opens and runs fine. I guess this goes to show, in case we didn't know it, we still can run into DLL versioning problems, especially when we're dependent on 3rd parties. All in all, it was no big deal, but it was a tiny bit frustrating. Now if only the nice NUnitAsp people will update their build.