Notes on Code Coverage for .NET Applications
07/15/2025
This post summarizes my learnings about code coverage visualization in SonarQube and GitLab.
Formats for GitLab and SonarQube
I'll detail different options for displaying code coverage for a C# (.NET) application in both tools. GitLab uses Cobertura coverage files. When such a file is uploaded as a job artifact, GitLab marks each line as covered or uncovered in a pull request (Merge Request in GitLab terms). GitLab also provides other coverage features that are not covered in this post.
SonarQube accepts several coverage formats. As of writing this post, for .NET applications it works with coverage files in these formats: