Io preferisco sempre inserire la logica dei Web Services in una DLL separata, in modo che sia banale da testare con gli Unit Test, avere le informazioni di Code Coverage, etc...
Ma se proprio dovete avere il Code Coverage direttamente dei Web Services (ad esempio dovete verificare della logica contenuta esclusivamente negli ASMX o simili) allora potete seguire questa strada:
The following is the updated process for doing code coverage on web services.
1. Read our team blog on code coverage here, especially scenario 3. Please note the path to vsinstr and vsperfcmd is %vsinstalldir%\Team Tools\Performance tools
2. Build your product and test binaries.
3. Instrument your product binaries using vsinstr as detailed in the blog
4. Reset iis.
5. Start the code coverage collection using vsperfcmd /start… as detailed in the blog
6. Open a VS commandline and go to your binary drop location, eg. dd\tcm_1\binaries\x86dbg\bin\i386, run tests using mstest:
mstest /testcontainer:ActivitiesTests.dll and mstest /testcontainer:ActivityRuntimeTests.dll
7. Reset iis.
8. Stop the code coverage collection using vsperfcmd /shutdown
9. Open the .coverage file that you get in IDE, check the numbers.
Fonte: MSDN Forums