Code Coverage In Visual Studio 2010

To run code coverage, you first need test settings for your solution. Right Click on your solution in Explorer and select new -> Test Settings


Then, you can hit configure and add in code coverage.

Once you add it in, you need to use the Test Output window:


Also, once your assembly is strong named, you need to add that to your tests:


Note that you are not running code coverage on your test .dlls, but on your working code assemblies.


VS2010 does many things well, the code coverage Easter egg hunt is not one of them.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: