Don’t believe NUnit

Just a quick note about a little problem I found using Nunit (2.2.9, but affects earlier revisions too).

After a bunch of edits to my project, I suddenly started getting messages from NUnit GUI “could not load file or assembly nunit.core”. Try as I could, this would not go away. This included everything from reinstalling NUnit to tracking DLL loading via SysInternal’s Process Explorer tool.
My project is non trivial – a top level solution containing an ASP2 web project, a couple of library DLL’s for the business logic, a unit test executable, and a testing helper library to help cross reference test results against direct SQL calls. As I’ll be writing about in another post shortly, incorporating unit testing into an ASP project is a pain in the rear and so I had been restructuring things. My natural assumption based on the error message was I had messed up something in the linking/referencing.

But it turned out to be an error in the application config file – for some reason NUnit reports this as a DLL missing, not that you have mistyped a bit of config text. I simply had a closing tag in the wrong place – still syntactically correct, however.
This link is by someone else who hit the exact same problem, and he has written about in more detail.

So remember folks: never assume a system generates the correct error message for all circumstances.

Leave a Reply