The intricacies of NCover

time to read 2 min | 264 words

Apperantly there are two project that goes by the name of NCover, they have the same purpose but very different implementations.

The first, which I've used and didn't much liked, uses code source instrumentation to check the code coverage of your code. I found it unreliable and quite messy to work with.

The seocnd, however, is much much better. It doesn't require code instrumentation, but rely on the profiler API to do its work. It gives a very details view of the code coverage in your code. However, it's not without its quircks, and I fought against it head on for the last couple of hours, so I thought to document some of the important thing here, for future refernce.

The first thing to notice is that the tool require that the CoverageLib.dll will be registered, this means that if you're moving it to a new computer using xcopy setup, you need to manually register the CoverageLib.dll.

The second thing is that it can only create coverage reports for debug assemblies with their pdb files.

It took me quite some time to discover what was wrong, as there was no error, just empty result files.

"Most hospitals make money by selling the umbilical cords cut from women who give birth. They are reused in vein transplant surgery." -- Fact of lifes
"Zero to bitch in 2.4 seconds" -- Bumper Sticker
"The toothbrush was invented in 1498." -- Fact of lifes

[Listening to: רוחות מלחמה-רמי קלינשטיין - - (04:22)]