NUnit and DirectoryServices
I've been working a lot with Continous Integration lately with CruiseControl.NET. All was going well and I had a medium sized build process set up. Suddenly the NUnit2 task in the NAnt script for one of my testcomponents started failing in a completely random fashion. The only output in the nunit2 task in nant log displayed by ccnet was <task name="nunit2" /> .
I thought it was ccnet and then I thought it was the NAnt task. I could not reproduce the error properly, and there were no errs in the NAnt buildlog. Finally I ran the script manually from the buildserver a few times and reproduced the error which displayed in the console (but not in ccnets nant build log!):
AppDomain can not be unloaded because the thread ee8 can not be unwound out of it.
Thinking about what code was running in the test I realized that I had some System.DirectoryServices code in there somewhere. I placed a [Ignore] tag on that testfixture and all was good once again. What bugs me though is that this was not reproducable.
Also, in an automated build environment, when something like this goes wrong there are a million possible sources for the error: Visual Source Safe, any of the opensource solutions, my nant scripts, the code, running processes on the buildserver (i.e. windows indexing service locking files)..
Just glad I finally found it after way too many hours!