Getting code coverage for manual testing (or anything really)
This question crops up from time to time, and it was suggested that I just post this to my blog, since it seems it's rare enough that people have a hard time finding it :-)
The only reason I even have it is because an old lab that we had at Notion actually had students implement this. The following describes how to get code coverage on .NET applications without having to actually run "tests" in the VSTS context. You will need either Team Dev or Team Test installed to have the right tools to make this work.
Using the commandline you can instrument ANY .NET assembly (code signing can cause problems). Once that code is instrumtented, you need to actual get the "listener" running to collect the code coverage data this generated. Here's the basic steps:
First, you have to open a VS command prompt:
a. Instrument your assembly by executing:
vsinstr /coverage Assemblyname.dll
b. Start the Code Coverage monitoring process by executing:
vsperfcmd /start:coverage /output:yourfilename.coverage
Run your Application that contains the instrumented code
End the Code Coverage monitoring process by executing:
vsperfcmd /shutdown
You should then have a file with a "yourfilename.coverage" file in the application directory that you can open up in Visual Studio to view the results.