dotCover 2025.3 Help

Set up coverage filters

Coverage filters let you control which assemblies and symbols are included in or excluded from coverage analysis. Filters help you:

  • Reduce analysis time by skipping irrelevant code.

  • Focus results on your project or working area.

  • Exclude test helpers, third-party libraries, or generated code.

Filter types:

Runtime coverage filters

dotCover applies these filters during a coverage session. Use these filters to exclude unnecessary code from analysis and reduce coverage session time.

You can configure runtime filters in dotCover settings or using the command line.

Filters of coverage results

dotCover applies these filters to coverage results (coverage tree) after the coverage session is over. Use them to exclude nodes you don't want to see at the moment. Learn more

Apply runtime coverage filters

Use dotCover settings to specify runtime coverage filters for a specific namespace or attribute.

As filters are applied in runtime, dotCover does not include the filtered items in the coverage snapshot and does not show them in the Coverage Results Browser window or in the Unit Test Coverage window .

Add a runtime coverage filter

  1. Open the filter settings page in the ReSharper settings: dotCover | Filtering.

  2. In Runtime coverage filters, click Add filter Add ... next to the required filter rule:

    • Do not analyze code in assemblies – exclude specific assemblies (e.g. *.Tests). This is useful for test utilities or external SDKs.

    • Do not analyze code marked with attributes – exclude classes, methods, or properties marked with a specific attribute. Specify a fully qualified attribute name, for example, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute or *.ExcludeFromCodeCoverageAttribute.

    You can use asterisk wildcards when specifying code item names in a filter: * (asterisk) represents zero or more characters.

  3. Click Save.

Share runtime coverage filters

Solution-wide filters are saved in the Solution team-shared settings layer and, therefore, can be shared within other developers who work on this solution.

In fact, all you need to do to share solution-wide filters is to put the [SolutionName].sln.DotSettings file in your solution folder under a version control system (VCS). As soon as other team members get this file from VCS the filters will be applied on their computers as well.

Note that other JetBrains products that integrate into Visual Studio may store their solution-wide team-shared settings in the same file. Therefore, if you put this file under VCS, bear in mind that other product's settings may be shared as well. For more information, refer to Manage and share dotCover settings.

Apply filters to coverage results

dotCover applies these filters to coverage results after a coverage session is over. Use result filters to temporarily hide items from the coverage tree in the UI. These filters do not affect analysis or the generated snapshot.

Exclude a node (namespace, class, class member) from coverage results

  1. Open coverage results either in the Coverage Results Browser window or Unit Test Coverage window.

  2. Select a node and in the context menu select:

    • Exclude from Coverage Results to exclude the node from the current results.

    • Exclude All But This to leave only the selected node in the coverage tree.

Show the excluded nodes back

02 July 2025