I am using Testdriven.net to run NCover on my assemblies. However, I need to exclude certain methods from the coverage report. How can I do this?
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.
This can be achieved by declaring an Attribute named
CoverageExcludeAttributein the global (sometimes referred to as the empty) namespace and applying this Attribute on the methods you want excluded from NCover.NCover will pick up this attribute by its name only, so there’s no need to reference any external assemblies. See also this post. (It doesn’t mention that the
CoverageExcludeAttributemust be defined in the global namespace).