Exclude Attributes to dotCover are ignored

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:

-:module=CommonUtilities;ExcludeFromCoverage

I have also tried a simple:

-:ExcludeFromCoverage

as well as

-:ExcludeFromCoverageAttribute

My custom attribute is defined as follows:


[AttributeUsage(AttributeTargets.Class |
                    AttributeTargets.Enum |
                    AttributeTargets.Interface |
                    AttributeTargets.Delegate |
                    AttributeTargets.Method |
                    AttributeTargets.Assembly)]
    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:

    [ExcludeFromCoverage]
    public class ABCD {...}


are still being considered for coverage. What am I missing?

Please sign in to leave a comment.