Enabling Code Coverage in Visual Studio 2010

Posted by Stuart Preston on April 13, 2010 under Team Foundation Server | 2 Comments to Read

Hopefully this will save someone a minute or two.

In Visual Studio 2010 to enable Code Coverage, you edit the .TestSettings file (e.g. Local.TestSettings) – similar to the TestRunConfig file in Visual Studio 2008.  Code Coverage no longer has its own section – it can be found under Data and Diagnostics where you can then set Code Coverage to enabled by checking the box.

image

The subtle thing I missed for a couple of minutes was that the Configure button at the top of the grid only is enabled when you select the Code Coverage row – and in there is the Code Coverage Detail dialog that lets you select the “artifacts to instrument”.

Looks pretty obvious now huh!

Add A Comment