Steps for recording code coverage without relying on Unit Test Cases for a Web Application
This shows how to record coverage for WCF services hosted over IIS, this method of recording code coverage has no reliance on UTC(s).
- Instrument all application DLL(s) in all the applications (Web & App Server both, depending on the requirement).
- Open Visual Studio Native Command Prompt X64 in administrative mode
- Go to the bin directory of the application
- Run following command for each application DLL that you want to record(It will instrument the DLL with symbols) VSINSTR /COVERAGE <DLL Name>
- Above command will generate an instrumented DLL(s), original ones would be renamed as <filename>.dll.orig
- Stop IIS IISRESET -STOP
- Start the performance recorder daemon
- Open Visual Studio Native Command Prompt X64 in administrative
mode and run (either 1st option or 2nd option)
- START VSPERFMON /COVERAGE /OUTPUT:<FileName>.coverage /CROSSSESSION /USER:Everyone
- VSPERFCMD /START:COVERAGE /OUTPUT:<FILENAME>.coverage /CROSSSESSION /USER:Everyone
- Above command should spawn a new command window and you will see a running process there. (if 1st option is chosen; 2nd option will spawn the daemon in background)
- Start the IIS IISRESET -START
- Let the application run and tested by the testers (functional/system test cases), if you are recording the coverage with VSPERFMON then you should see W3WP.exe listed on the newly spawned command window.
- Once the functional and regression testing is done, stop the IIS using following command IISRESET -STOP
- Stop the daemon VSPERFCMD /SHUTDOWN
- Open the coverage file by double clicking on a machine that has Visual Studio
>PROMPT X64::





