dotCover 2021.2 Help

Windows Services

Control+Alt+K K

In Visual Studio:
ReSharper | Cover | Cover Application...
ReSharper_CoverApplication

In dotCover standalone application:
File | Cover Application...

With dotCover, you can run coverage analysis for Windows services.

Before you start analyzing coverage for a Windows service, make sure that your service is installed in the system. For more information on installing and uninstalling Windows services, see How to: Install and Uninstall Services

To start a coverage run for a Windows service

  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... in the menu.

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

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

    • In the New Run Configuration wizard, choose Windows Service and click Next.

    • Specify service options:

      • Service: a name of the service you are going to analyze. dotCover scans the installed services automatically.

      • Arguments: optional arguments passed to the service.

      • Start dependent services: select this checkbox if the service requires other services to be started.

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

    • Click Save.

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

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

  5. 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: 05 April 2021