How to customize color settings for Code Coverage Result in Visual Studio ?

By | June 22, 2015

This question came up after one of our previous post – Understanding Code Coverage – How to determine which portion of code is being tested in Visual Studio ? .  We discussed about different colors of code coverage area and how it looks like when the code is covered, not covered or partially covered.  For few, the colors were different than what we have seen over the other post,  so the question was, can we customize the code coverage colors ? Yes. We can do it.

Here is the default color for the different set of code coverage block.

Default Coloring of Code Coverage

Default Coloring of Code Coverage

To change color, or customize the style, you need to open Options Dialog window, from Tools –> Options.  Then search for “Fonts and Colors” option in the right side tree explorer.  Once Fonts and Colors is selected, search for “Coverage… “ under Display Items. You will find following three Display items

  • Coverage Not Touched Area
  • Coverage Partially Touched Area
  • Coverage Touched Area

Related Post : Search within Options Dialog Control – Visual Studio

Code Coverage Options

Code Coverage Options

Now, you can change the default color, fonts and styles for the individual items.

Code Coverage Settings Change

Code Coverage Settings Change

Here is one example of different set of code coverage colors.

Customize Code Coverage Color

Customize Code Coverage Color

 

Hope this helps.

3 thoughts on “How to customize color settings for Code Coverage Result in Visual Studio ?

  1. Pingback: Visual Studio Code Coverage Color Settings

  2. Pingback: Dew Drop – June 23, 2015 (#2040) | Morning Dew

  3. Pingback: .NET Tips and Tricks from Daily .NET Tips – June 2015 Links | Abhijit's World of .NET

Comments are closed.