Code Coverage shows 0% in SonarQube

I am writing to request assistance in troubleshooting an issue I am experiencing with code coverage in SonarQube Developer Edition. Specifically, although I generate code coverage reports using dotCover that show 98% coverage, the SonarQube interface displays 0% coverage for my codebase.

I use the following properties with dotnet sonarscanner
dotnet sonarscanner begin /key:{projectKey} /d:sonar.verbose=true /d:sonar.cs.dotcover.reportsPaths=CodeCoverageResults/CodeCoverageResults.html /d:pullrequest.key={PRKey} /d:pullrequest.branch={PRBranch} /d:pullrequest.base=master

[2023-04-26T20:19:41.665Z] 16:19:41.436 DEBUG: Analyzing coverage with wildcardPatternFileProvider with base dir 'C:\j\workspace\Control.Integration.XSight_PR-14\.' and file separator '\'.
[2023-04-26T20:19:41.665Z] 16:19:41.436 DEBUG: Pattern matcher extracted prefix/absolute path 'C:\j\workspace\Control.Integration.XSight_PR-14\.\CodeCoverageResults\CodeCoverageResults.html' from the given pattern 'CodeCoverageResults/CodeCoverageResults.html'.
[2023-04-26T20:19:41.665Z] 16:19:41.436 DEBUG: Pattern matcher returns a single file: 'C:\j\workspace\Control.Integration.XSight_PR-14\.\CodeCoverageResults\CodeCoverageResults.html'.
[2023-04-26T20:19:41.665Z] 16:19:41.436 DEBUG: The current user dir is 'C:\j\workspace\Control.Integration.XSight_PR-14'.
[2023-04-26T20:19:41.665Z] 16:19:41.436 INFO: Aggregating the HTML reports from 'C:\j\workspace\Control.Integration.XSight_PR-14\.\CodeCoverageResults\CodeCoverageResults.html'.
[2023-04-26T20:19:41.665Z] 16:19:41.436 DEBUG: dotCover aggregator: collected 1 report files to parse.
[2023-04-26T20:19:41.665Z] 16:19:41.436 INFO: Adding this code coverage report to the cache for later reuse: C:\j\workspace\Control.Integration.XSight_PR-14\.\CodeCoverageResults\CodeCoverageResults.html
[2023-04-26T20:19:41.665Z] 16:19:41.436 DEBUG: Analyzing coverage after aggregate found '0' coverage files.
[2023-04-26T20:19:41.665Z] 16:19:41.436 DEBUG: The total number of file count statistics is '0'.
[2023-04-26T20:19:41.665Z] 16:19:41.436 INFO: Sensor C# Tests Coverage Report Import [csharp] (done) | time=0ms
[2023-04-26T20:19:41.665Z] 16:19:41.436 INFO: Sensor Zero Coverage Sensor
[2023-04-26T20:19:41.665Z] 16:19:41.451 INFO: Sensor Zero Coverage Sensor (done) | time=15ms

Result in SQ:

dotcover generated HTML file:

I am currently running:

  • SonarQube Developer Edition Version 9.4 (build 54424) on Windows.
  • Tool ‘dotnet-sonarscanner’ (version ‘5.13.0’)
  • JetBrains dotCover Console Runner 2021.2.2. Build 777.0.20211008.82358.
  • SonarScanner for MSBuild 5.13.

I have attempted to troubleshoot the issue by reviewing the documentation and forums, but have been unable to find a solution. coverage-troubleshooting-guide-for-net-code-coverage-import


Your version is past EOL. You should upgrade to either the latest version or the current LTS at your earliest convenience. Your upgrade path is:

9.4 → 9.9 → 10.0 (last step optional)

You may find the Upgrade Guide helpful. If you have questions about upgrading, feel free to open a new thread for that here.

Regarding your question, you may find this guide helpful: Troubleshooting .NET code coverage import.


Hi Ann

Thank you for answering.
Regarding the upgrade, we already have it planned for next month.

As I mentioned in my post, I already tried the steps in Troubleshooting .NET code coverage import. But it is not solved.

Can you please help?


It’s difficult to support something that’s officially been EOL since last summer. I will say, though, that I find the .\ in your path suspicious.


I resolved this issue by the following:
When running the dotCover command
dotCover cover|c <parameters> [-- <target arguments>]
I used cover --test -c release Which is generating a code coverage HTML report without the details of each line of code.

removing the parameter release solved the issue,m it generates a detailed HTML code coverage report which is reflected correctly on SonarQube.

I think docover source mapping needs to be specified.
But overall this issue is resolved.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.