dotCover 2023.3 Help

Start Coverage Analysis for External Applications

dotCover lets you run coverage analysis for .NET applications and processes that have PDB information. You can analyze coverage for the following types of applications and processes:

Configuring process filters

If the profiled application creates a number of processes, use the Process filters setting to specify what processes you want to profile. You can either select a predefined filter or create a new one.

Note that process filters work differently depending on the application type specified in the selected run configuration.

App type

Description

Standalone

.NET Core Application

dotCover will run analysis only for the processes that match the specified filter. The filter is applied to the entire process tree of the analyzed process (including child processes).

For example, you have a managed process that creates a number of child processes. You want to analyze not only the main process but also child processes with service in their name. To do this, add the *service* include filter.

.NET Process

In this mode, starting the coverage session does not start the analyzed process. Instead, dotCover waits for and attaches to the first managed process started in the operating system. When certain Process filters are selected, dotCover will attach to the first process that matches the filter.

For example, you created the include filter: *service*. dotCover will attach to the first process in the system with service in its name.

IIS

IIS Express

Windows Service

WCF Service

WinRT Application

Process filters are not applied.

To select a process filter

  1. Under Specify coverage options, open the Process filters list.

  2. Select the required filter.

    dotCover provides two predefined filters:

    • Default: process filter is not applied.

    • Entire process tree: dotCover will analyze the entire process tree including child processes. In case a .NET Process run configuration is selected, dotCover will attach to and analyze the first managed process started in the system including all its child processes.

    Select a predefined filter

To create a process filter

  1. Under Specify coverage options, open the Process filters list.

  2. Choose Add Filter.

  3. Specify filter settings:

    • Name: filter name.

    • Profile entire process tree: if selected, dotCover will analyze the entire process tree including child processes. Disabling this option makes sense only if you create a filter for the .NET Process run configuration. In this case, dotCover will wait for and attach to the first process in the system that matches the filter but it will not analyze child processes of this process.

    • Include filter masks, Exclude filter masks: include and exclude filter masks correspondingly. The masks are applied according to the following rules:

      • The default policy is 'analyze all'.

      • Include masks are applied first. Exclude masks are applied to the processes filtered by the include masks.

      • You can use asterisk * wildcards.

      For example, to analyze all child processes with Service in their name excluding MyService, add the *Service* include mask and the MyService exclude mask.

  4. Click Save.

Locating symbol files (PDB) for the target binaries is vital for calculating coverage. If you cover unit tests or cover the startup project, dotCover easily locates symbol files using the structure of the current solution.

By default, dotCover search symbol files in the following places:

  • in the same directory where the binary file resides;

  • in the debug directory that is specified inside the binary file;

  • in all directories specified in the _NT_SYMBOL_PATH environment variable and in the registry;

If necessary, you can specify other places to look for symbol files. To do so, in the Coverage Configuration dialog, click Edit Symbol Search Policy.

In the Symbol Search Policy dialog that opens, you can add the following ways to search for symbol files:

  • In the Search path field, provide a semicolon separated list of paths to search for symbol files. Each path can be either a directory path or a symbol server path (for example, srv*C:\LocalSymbols*http://symbolserver:33417/).

  • Select the Access symbol server to allow dotCover access symbol servers specified either in the Search path field, or in _NT_SYMBOL_PATH environment variable.

You can also disable some of the default ways to search for symbol files.

Last modified: 11 January 2024