Attribute filter syntax for code coverage in TeamCity

Posted on

Problem :

Anyone knows the syntax for excluding code from coverage in Teamcity? I am using the ExcludeFromCodeCoverageAttribute on certain methods and want those excluded. It works well in Visual Studio but I don’t understand how to get the same behavior in TeamCity. The Field I am trying to configure is located in MsTest -> .Net Coverage -> Attribute Filters:
I have tried this:


and this


Solution :

After trying out a few variations this worked:


Make sure you add this filter inside Attribute Filter:


enter image description here

Leave a Reply

Your email address will not be published. Required fields are marked *