Visualizing the code coverage results from Azure Pipelines in Visual Studio

 
 
  • Gérald Barré

In a previous post, I explained how to compute code coverage for a .NET Core project with Azure DevOps and Coverlet. In this post, the code coverage visualization could be done directly in Azure DevOps. As a developer, you want to see these results directly into the IDE.

  1. Download the code coverage file from the build artifacts

  2. Open the file in Visual Studio

  3. In the "Code Coverage Results" tool window, find the method you want and double-click on it to open the file in the editor with the coverage highlight

Be sure to click on the "Show Code Coverage Coloring" button in the tool window. Visual Studio highlights the lines with 3 different colors:

  • Green: block is covered
  • Orange: block is partially covered
  • Red: block is not covered

You can now quickly view where you can improve your coverage!

This post is part of the series 'Visual Studio Tips and Tricks'. Be sure to check out the rest of the blog posts of the series!

Do you have a question or a suggestion about this post? Contact me!

Follow me:
Enjoy this blog?Buy Me A Coffee💖 Sponsor on GitHub