Archive for 09:33 PM

Gendarme Integration for VS2008

09:33 PM

Ever since setting up our CruiseControl.NET server for our internal projects, I wanted to integrate a Gendarme run to catch all those nasty little things that slip through, like not checking arguments for null.

Now that I finally found some tuits to do it, the next problem became obvious: doing a quick commit often lead to a quick build fail. Gendarme would have no use if it didn’t find anything, no? So the missing piece was integration into Visual Studio. Arthur hacked together a little XSLT+PowerShell and voila, Gendarme now runs on every build right from the studio and populates the “Error List” window with properly linked entries. Yay!

Read on for the details of the implementation. The complete source is downloadable at the end of the article.

(more…)

AppDomainUnloadedException with NUnit, a ServiceHost and several other technologies

05:03 PM

All tests ok, but still a NUnit failure?

Seeing unexplicable “System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain.” errors?

You might be a victim of nunit’s bug #423611.

See also here, here and here.

A typical error message looks like this:

Unhandled exceptions:
1) : System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain.

I’ve uploaded a minimal solution exhibiting the problem to the bugreport and I hope that’ll help clearing the issue up.

CruiseControl.NET and other open source stuff

12:49 PM

Recently I’ve spent some time setting up a CruiseControl.NET instance for our internal projects. Using this project, we have an automatic and immediate feedback whether our checkins work without having to waste developer time waiting on the full unit test suite.

To improve response times of the server running CC.Net while integrating, I’ve applied the ProcessPriority patch from CCNET-504 and now run all processes at BelowNormal. Now there is no noticeable impact on other services on the server while a build is running. Since the patch didn’t apply cleanly to the newest CC.Net version, I updated the patch to current HEAD and posted it in the bugtracker. Thanks to Craig Sutherland the patch is now applied in the HEAD and will be released with 1.5. Having already wet my feet, I proposed a refactoring for the Tasks to move all common properties to the BaseExecutableTask class, thereby removing ~300 lines of code and unifying the diverse set of properties currently in the wild. This will have to wait for the next release in order to not interfere with a timely 1.5 release.

Currently CC.Net builds the projects from subversion, runs all unit tests with NUnit and checks code quality with Gendarme.

While integrating Gendarme in our build process, I found and reported two bugs in the rules, which triggered false positives on our code. Thanks to Sebastien Pouliot both appear to be already fixed and slated for release with the next Gendarme (2.8).