In Visual Studio:
In dotCover standalone application:
With dotCover, you can run coverage analysis for Silverlight Web applications that have PDB information. dotCover will start the page where the target Silverlight application is hosted in the specified Web browser, allowing you to execute the coverage scenario and record it.
Before you start analyzing coverage of a Silverlight application, make sure that:
Silverlight 4 Developer Runtime or higher is installed on your computer. You can get the runtime at the Official Microsoft Silverlight web site.
A Web page with your Silverlight application is started and running on a Web server.
To start a coverage run for a Silverlight application
- Do one of the following:
In Visual Studio, press Ctrl+Alt+K K or choosefrom the main menu
In dotCover standalone application, press Ctrl+Alt+K K or choosein the menu.
In the Coverage Configuration dialog that appears, choose Silverlight Application.
In the Open URL field, type the URL of the web page where your Silverlight application is hosted. As long as you have PDB information, it is not important whether the Web page is running on the local or a remote server.
If necessary, in the in browser drop-down list, change the web browser that should be used to open the web page.
To analyze coverage of a Silverlight web application, dotCover needs to restart the web browser process. If your default browser is currently in use, close it or choose another browser.
The only place where dotCover can find PDB information of your Silverlight application is an explicitly specified path.
Click Edit Symbol Search Policy button and specify the path in the Search path field. For more information, see PDB and symbol search policy.
Optionally, select the Advanced check box to configure additional settings: 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.
- Click Run. dotCover will open the Coverage Controller dialog and then
run the specified Web page with the Silverlight application in the selected Web browser.
If the Collect profiling data from start 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.