dotCover 2024.1 Help

WCF Services

With dotCover, you can run coverage analysis for WCF Service Libraries that have PDB information. dotCover will start the specified WCF Service Library and optionally a client application, allowing you to execute the coverage scenario and record it.

To start a coverage run for a WCF Service Library

  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 analyzed application:

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

    2. In the New Run Configuration wizard, choose WCF Service and click Next.

    3. Specify application options:

      • Library path: the full path to the WCF service library.

      • Config path: the full path to the WCF service library configuration file.

      • WCF host: the WCF host to use. Depending on the installed .NET framework versions, this list will yield different options.

      • Client path: the path to a custom client executable that must be run after services are hosted.

      • Client arguments: command-line arguments that are passed to the custom client application.

      • Set environment variables: lets you run the analyzed 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. 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: 09 April 2024