Ncover is no longer free, and if you want to use code coverage in your build scripts, without paying for it, you need to find another solutions. In my case, this solution is partcover. It works pretty much like Ncover do (did) and you can include it in your MSbuild scripts to cover unit tests. Partcover uses some COM stuff and needs to be registered (you can of course install the msi on every computer you run partcover on and the problem is solved). I prefer that all the tools I use together with my build scripts, work without me installing anything. Adding the target shown below to your MSbuild script will make it possible to use partcover without installing it.
What it does is to register the PartCover.CorDriver.dll before partcover is run, and unregister it after partcover is run.
To run this script you need to run under administrator privileges.
Tags: partcover buildscripts