dotCover 2016.3 Help

Web Application on IIS or IIS Express Server

Ctrl+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 Web applications on IIS and IIS Express servers. dotCover will start the specified server for you and optionally a Web browser with the page of the target application.

Before you run coverage analysis for a Web application on IIS or IIS Express server, make sure that:

  1. IIS or IIS Express is installed on your computer. Otherwise you should install it:
    • To enable IIS on Windows XP:
      Select the check box next to Internet Information Services (IIS) in Windows Components Wizard. To open the wizard, click Start and choose Control Panel | Add or Remove Programs | Add/Remove Windows Components.
    • To enable IIS on Windows Vista and Windows 7:
      Select the check box next to Internet Information Services in the Windows Features dialog. To open the dialog, click Start and choose Control Panel | Programs and Features | Turn Windows features on or off.
  2. Your Web application is deployed to IIS. For more information, see Deploying Web Sites on IIS.
    If you use IIS express, dotCover can deploy your application automatically before the coverage run.
  3. Caching in your Web browser is disabled. Alternatively, use Ctrl+F5 to manually refresh the page that is running the target application.

To start a coverage run on IIS server

  1. Do one of the following:
    • In Visual Studio, press Ctrl+Alt+K K or choose ReSharper | Cover | Cover Application... in the main menu
    • In dotCover standalone application, press Ctrl+Alt+K K or choose File | Cover Application... in the menu.
  2. In the Coverage Configuration dialog that appears, choose IIS.
    Note that you must have Administrator permissions to start a coverage run on IIS server.
  3. Tick the Open URL check box and type the URL of your Web application. If necessary, change the browser that should be used.
  4. Optionally, tick the Advanced check box to configure additional settings:
    • Click Edit Symbol Search Policy to specify where to search for PDB information.
    • Click Edit Filters to view existing and add new coverage filters. Note that the filters you add with this button are only applied to the current session.
  5. Click Run. dotCover will open the Coverage Controller dialog and then start the IIS server. You need then navigate to your application Web page in a browser or press Ctrl+F5 to refresh the page.
    If the Run Browser check box is selected, dotCover will start the selected Web browser or open a new Web page tab at the specified URL.
  6. If the Start immediately check box 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.

To start a coverage run on IIS Express server

  1. In the Coverage Configuration dialog that appears, choose IIS Express.
  2. To specify the target Web application, do one of the following:
    • If your Web application is deployed on the IIS Express server, select Configuration file, and then choose a site name in the Site drop-down list.
    • If your Web application is not deployed on the IIS Express server, select Application path, and then in the Application path field, specify the physical path of your Web application. dotCover will deploy your application before starting the coverage run.
  3. If you want to start a Web browser with your application, tick the Open URL check box and type the URL of your Web application. If necessary, change the browser that should be used.
  4. Optionally, tick the Advanced check box to configure additional settings:
    • In the Server drop-down list, choose one of the IIS Express servers installed on your computer.
    • The Configuration file field allows you to explicitly specify the IIS Express configuration file.
      As soon as you specify a valid configuration file, the list of available Web sites is updated accordingly.
    • The Runtime version field allows you to choose the .NET runtime version that will be used when deploying the application.
    • The Port field allows you to specify the Web server port that will be used when deploying the application. By default, the Web server port is detected automatically. To specify it explicitly, clear the Autodetect check box and type a new port number in the Port field.
    • Click Edit Symbol Search Policy to specify where to search for PDB information.
    • Click Edit Filters to view existing and add new coverage filters. Note that the filters you add with this button are only applied to the current session.
  5. Click Run. dotCover will open the Coverage Controller dialog and then start the specified web application on IIS Express server. You need then navigate to your application Web page in a browser or press Ctrl+F5 to refresh the page.
    If the Run Browser check box is selected, dotCover will start the selected Web browser or open a new Web page tab at the specified URL.
  6. If the Start immediately check box 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.

See Also

Last modified: 3 April 2017