dotCover 2024.3 Help

Web Applications Using IIS Express

With dotCover, you can run coverage analysis for web applications on IIS Express servers. dotCover will start the specified server for you and optionally a web browser with the page of the target application.

To start a coverage run on IIS Express server

  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. Close all running IIS Express instances.

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

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

    2. In the New Run Configuration wizard, choose IIS Express and click Next.

    3. Specify application options:

      • If the web app you want to profile is described in the default IIS Express configuration file applicationhost.config, select Configuration file and then, in Site, select a web site you want to analyze.

        Note that a config file location depends on a IDE you use:

        • JetBrains Rider: {solutionDir}\.idea\config\applicationhost.config

        • Microsoft Visual Studio 2015 and later: {solutionDir}\.vs\config\applicationhost.config

        • Microsoft Visual Studio 2013 and earlier: %USERPROFILE%Documents\IISExpress\config\applicationhost.config

        If you do not want to use a configuration file, you can select Application path and specify a full path to the directory that contains the analyzed application.

      • If you want the application URL to be opened automatically, once the session starts, select Open URL and specify the application URL. The in browser parameter allows you to select a browser in which the URL must be opened.

      • Optionally, you can specify custom IIS Express and runtime settings:

        • In Server, select an IIS Express instance,

        • in Runtime version: a .NET Framework version,

        • in Port: an HTTP port, or select Use random port if you want dotCover to automatically select the port.

      • Optionally, in Open URL, specify the URL that dotCover will use to invoke the web application after starting the session.

      • Optionally, in in browser, specify the browser that dotCover should use to open the URL.

    4. Click Save.

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

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

  6. 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