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
Do one of the following:
In Visual Studio, press Control+Alt+K K or choose
from the main menuIn dotCover standalone application, press Control+Alt+K K or choose
from the menu.
Close all running IIS Express instances.
Add a run configuration - the configuration that tells dotCover how to run the analyzed application:
UUnder Cover application, click Add run configuration.
In the New Run Configuration wizard, choose IIS Express and click Next.
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.
Click Save.
Make sure the created run configuration is selected in the New Process Run list.
Under Run analysis, click Start. dotCover will open the Coverage Controller dialog and then run the selected application.
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.