dotCover Web Help

In Visual Studio:
dotCover | Edit Coverage Filters

In dotCover standalone application:
File | Edit Coverage Filters

All coverage filters that affect the current solution, both per-solution and global, are displayed in the Coverage Filters dialog. If no solution is opened, the dialog shows only global filters. In this dialog, you can enable, disable, add, remove, and modify coverage filters.


You cannot edit coverage filters while the coverage analysis is in progress, e.g. when you started and not finished a manual test session under dotCover control or when the coverage analysis of unit tests is in progress.

To view and modify current coverage filters
  1. Do one of the following:
    • In Visual Studio, choose dotCover | Edit Coverage Filters on the main menu or press Ctrl+Alt+K,F.
    • In dotCover standalone application, choose File | Edit Coverage Filters
  2. In the Coverage Filters dialog that appears, you will see the list of filters specified globally ond for the current solution, if any.
  3. Use the Group by selector to change the grouping of filters - by scope or by kind.
  4. To enable or disable a filter, use the check-box next to it.
  5. To remove a filter, select it in the list and click Delete
  6. To edit a filter, select it in the list and clickEdit. In the Edit Coverage Filter dialog that appears, make necessary changes as described for adding a new filter below.
  7. Click Save to save and apply your modifications, if any.


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. For more information, see Sharing Coverage Filters.

To add a new coverage filter
  1. In the Coverage Filters dialog, click Add filter.
  2. In the Add Coverage Filter dialog that appears, choose the type of filter rule:
    • Analyze code in - to include the specified code item into code coverage analysis and exclude all other code items.
    • Do not analyze code in - to exclude the specified code item from code coverage analysis.
    • Do not analyze code marked with attribute - to exclude code items with the specified attribute from code coverage analysis.
  3. If you have chosen one of the first two options, specify an assembly, a class, and/or a method to be included or excluded in the coverage analysis. Code items are filtered independently on one another. For example, if you specify a method and leave asterisks (*) for assembly and class to exclude methods with the specified name from all assemblies and all classes.
  4. If you have chosen the last option, specify the name of the attribute that will be used to exclude symbols from the coverage analysis. Optionally, specify the assembly name where this attribute is declared.
  5. In the Apply filter to section, specify the scope of the filter: All solutions or Current solution.
  6. Click OK to finish adding the filter.
  7. In the Coverage Filters dialog, click Save to save and apply your modifications.


You can use asterisk wildcards when specifying code item names in a filter: '*' (asterisk) represents zero or more characters.
For example, you can use the *.Tests wildcard that will exclude all test projects from code analysis.