You'll quickly find out that enabling code coverage in Visual Studio 2010 has changed. With the new version you enable this functionality through the test settings. The following steps will enable code coverage:
- Open the local.testsettings which you can access from Test -> Edit Test Settings -> Local (local.testsettings)
- Select Data and Diagnostics from the list
- Select the Enabled checkbox on the Code Coverage row
- Double-click the Code Coverage row
- Select the assemblies you want to instrument
- Specify a re-signing key file if your assemblies are strong-named
- Click OK
- Click Apply
- Click Close