dotCover 2024.3 Help

.NET and .NET Core Applications

With dotCover, you can run coverage analysis for .NET Core applications: self-contained application deployments that have a .exe executable file or framework-dependent deployments that have only a .dll file.

To start a coverage run for a .NET Core application

  1. Do one of the following:

    • In Visual Studio, press Control+Alt+K K or choose ReSharper | Cover | Cover Application… from the main menu

    • In dotCover standalone application, press Control+Alt+K K or choose File | Cover Application... from the menu.

  2. Add a run configuration - the configuration that tells dotCover how to run the profiled application:

    1. Under Cover application, click Add run configuration Add run configuration.

    2. In the New Run Configuration wizard, choose .NET Core Application and click Next.

    3. Specify application options:

      • Path to the application executable (if it's a self-contained deployment) or to a library file (if it's a framework-dependent deployment).

      • Command-line Arguments for the executable (if required).

      • A full path to the application Working directory (by default, it's the same directory where the executable is located).

      • Set environment variables lets you run the profiled application with specific environment variables. Each variable must be specified on a new line.

    4. Click Save.

  3. Make sure the created run configuration is selected in the New Process Run list.

  4. Optionally, if your application creates a number of processes, and you want to profile only specific ones, create or select process filters in Process filters under Specify coverage options.

  5. Optionally, click Edit Symbol Search Policy to specify where to search for PDB information.

  6. Under Run analysis, click Start. dotCover will open the Coverage Controller dialog and then run the selected application.

  7. If the Collect coverage data from start checkbox was selected, the coverage run starts immediately. Otherwise, dotCover waits until you click Start in the Coverage Controller dialog. When the coverage run is started, you can record code coverage.

Last modified: 22 March 2024