SonarQube not showing OpenCover code coverage from report

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
  • I’m running community edition
  • sonar-scanner-msbuild-
  • NUnit.ConsoleRunner.3.12.0
  • OpenCover.4.7.1189
  • ReportGenerator.4.8.8
  • what are you trying to achieve
    I’m trying to get Code coverage to show in SonarQube project page. Currently it is reporting as 0% but my generated open cover.xml is reporting coverage of 10%

  • what have you tried so far to achieve this
    I’m running the following cmds:
    SonarScanner.MSBuild.exe begin /k:“PWS” /d:sonar.login="[Guid]" /d:sonar.cs.nunit.reportsPaths=D:\jenkins\CI_4_Server_Pipeline\Server\PWS\TestResults.xml /d:sonar.cs.opencover.reportsPaths=D:\jenkins\CI_4_Server_Pipeline\Server\PWS\GeneratedReports\CoverageReport.xml

MSBuild.exe D:\jenkins_DPA\CI_4_Build_Server_Pipeline\Server\PWS\PWS.sln /t:Rebuild

SonarScanner.MSBuild.exe end /d:sonar.login="[Guid]"

I can see the sonarQube report code smell, security issues etc, but code coverage remains at 0%
The output from the end cmd states that it is looking at the correct opencover.xml file.

It still doesn’t make its way into the sonarqube report.

Any help is much appreciated.


Hi @MarkBeattie

Welcome to SonarSource Community! :sonarsource:

Please review this guide I wrote: [Coverage] Troubleshooting guide for .NET code coverage import

If you still have an issue, please show your DEBUG scanner logs here.