Exclude Attributes to dotCover are ignored

Cross-posted on the TeamCity forum as well

I have tried to specify the exclude attributes to dotCover 2.0 in TeamCity Enterprise 7.1.2. Here is how I have specified them:


I have also tried a simple:


as well as


My custom attribute is defined as follows:

[AttributeUsage(AttributeTargets.Class |
                    AttributeTargets.Enum |
                    AttributeTargets.Interface |
                    AttributeTargets.Delegate |
                    AttributeTargets.Method |
    public sealed class ExcludeFromCoverageAttribute : Attribute
        private readonly string reason;

        public ExcludeFromCoverageAttribute(string reason)
            this.reason = reason;

        public ExcludeFromCoverageAttribute()
            reason = "Not required for coverage computation";

But the classes marked as follows:

    public class ABCD {...}

are still being considered for coverage. What am I missing?
1 comment
Ekaterina Solovova
Comment actions Permalink

Hello Anand,

Sorry for the late reply!
Please try to use the fully qualified name of your attribute class in the filter string: -:Your.Namespace.ExcludeFromCoverage or -:module=CommonUtilities;Your.Namespace.ExcludeFromCoverage. Or you can use an asterisk (*) wildcard instead of the full namespace: -:*ExcludeFromCoverage.

Please let me know whether it helps. Best regards.


Please sign in to leave a comment.