Enabling Code Coverage in Visual Studio 2010

 

1. Open the local.testsettings which you can access from Test -> Edit Test Settings -> Local (local.testsettings)

image

 

2. Select Data and Diagnostics from the list

image

3. Check the enabled checkbox on the Code Coverage row

4. Click on the Configure button or double click the Code Coverage row

5. Select the assemblies you want code coverage to be generated for

image