views:

40

answers:

1

Is there any chance I'll run into trouble checking coverage with release code in .Net? (I.E. Methods inlining or similar compiler magic?)

+1  A: 

The unit of code used by code coverage tools (both NCover and VSTS), is the sequence point found in PDB (the dark red section of code highlighted when you put a break point at debug time).

Thus if you don't have your PDB files generated you won't have code coverage metrics. To answer your question, you can do have code coverage metrics on Release mode as long as you generate PDB files (didn't test it myself but I thing it is 95% sure)

You won't have problem with things like Compiler inline that happens during IL -> asm compilation at runtime, performed by the CLR Just in Time compiler.

Patrick Smacchia - NDepend dev
On our build server Id much rather have one single build to support both tests and coverage (and id rather have it as close as possible to our production code). So I'll go ahead with the release code and see how it behave. Thank you.
Benoittr