Import Dotcover coverage report always 0%

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
  • how is SonarQube deployed: zip, Docker, Helm
  • what are you trying to achieve
    Import dotcover coverage report html file into Sonarqube
  • what have you tried so far to achieve this
  1. SonarScanner.MSBuild.exe begin /k:“ken” /d:sonar.token=“” /“http://localhost:9100” /d:sonar.verbose=true /d:sonar.cs.dotcover.reportsPaths=“.\dotcover\fullreport.html”
  2. SonarScanner.MSBuild.exe end /d:sonar.token=“”
  3. Output of END command:
    21:40:25.058 DEBUG: Analyzing coverage with wildcardPatternFileProvider with base dir ‘C:\p4\dev\IA_Trunk\Src\Build.’ and file separator ''.
    21:40:25.059 DEBUG: Pattern matcher extracted prefix/absolute path ‘C:\p4\dev\IA_Trunk\Src\Build..\dotcover\fullreport.html’ from the given pattern ‘.\dotcover\fullreport.html’.
    21:40:25.060 DEBUG: Pattern matcher returns a single file: ‘C:\p4\dev\IA_Trunk\Src\Build..\dotcover\fullreport.html’.
    21:40:25.060 DEBUG: The current user dir is ‘C:\p4\dev\IA_Trunk\Src\Build’.
    21:40:25.060 INFO: Aggregating the HTML reports from ‘C:\p4\dev\IA_Trunk\Src\Build..\dotcover\fullreport.html’.
    21:40:25.062 DEBUG: dotCover aggregator: collected 1 report files to parse.
    21:40:25.062 INFO: Adding this code coverage report to the cache for later reuse: C:\p4\dev\IA_Trunk\Src\Build..\dotcover\fullreport.html
    21:40:25.062 DEBUG: Analyzing coverage after aggregate found ‘0’ coverage files.
    21:40:25.062 DEBUG: The total number of file count statistics is ‘0’.

Hey there.

Have you checked the file at C:\p4\dev\IA_Trunk\Src\Build..\dotcover\fullreport.html to make sure it actually contains accurate coverage data?

Thanks for the reply.

Could you clarify what you meant by “accurate coverage data”?
I clicked C:\p4\dev\IA_Trunk\Src\Build…\dotcover\fullreport.html and I can see valid coverage data in the browser and the result matches what I see in DotCover viewer.

Is there a specific version of DotCover report that SonarQube only supports?

Hey there.

I guess I just mean… data that matches the files your analyzing and is up to date (regenerated with each build). We can put that aside for now (and no, no specific version of the dotCover report to consider)

Stepping back to your original post:

Is this really all that’s happening? Is there a build command and a test command as well? Can you share the full configuration of your pipeline?