Search code examples
sonarqubesonarqube-msbuild-runner

SonarQube C# DotCover report in xml


Is there any way to use the .xml output from a DotCover analysis when importing into SonarQube using the scanner for MSBuild?

Currently running:

  • SQ 5.4
  • C# Plugin 5.0

This is the specific SonarQube property key in question: sonar.cs.dotcover.reportsPaths

The example shown in this guide tells me that only the .html extension is accepted. Why is that? I am coming from a world where we save the report outputs in .xml and later transform it into an .html report. Is there a way to use the .xml output?


Solution

  • There is unfortunately no way to import the dotcover XML format. Your best bet is probably as you mentioned generate the dotcover HTML format as you mention above.

    There is one alternative - I wonder if it is not more convoluted that generating the dotcover HTML format from the start - : Convert the dotcover XML files into the SonarQube Generic Test Coverage XML format and import with the Generic Test Report plugin. This is usually quite easy to do with a XSLT transformation