Is there any chance I’ll run into trouble checking coverage with release code in .Net?
(I.E. Methods inlining or similar compiler magic?)
Is there any chance I’ll run into trouble checking coverage with release code in
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.