'Unable to get next XML event while parsing file'

Using SonarQube * Enterprise Edition

  • Version 7.9.1 (build 27448)

Using Jenkins, I cannot import the Codecoverage XML

This is the Output from the Console:
INFO: Sensor C# Tests Coverage Report Import [csharp]
INFO: Parsing the Visual Studio coverage XML report C:\Users\FNM1AV\Desktop\JenkinsSlave\workspace\Security_Utilities_master.\TestResults\RP88AV.coveragexml
WARN: Unable to get next XML event while parsing file ‘.\TestResults\RP88AV.coveragexml’
WARN: Could not import coverage report ‘.\TestResults\RP88AV.coveragexml’ because ‘Error while parsing the XML file: C:\Users\FNM1AV\Desktop\JenkinsSlave\workspace\Security_Utilities_master.\TestResults\RP88AV.coveragexml’
INFO: Sensor C# Tests Coverage Report Import [csharp] (done) | time=7ms

The file seems to be correct, could you please check if there is anything wrong with it? I annexed it as a .txt file to this topic

RP88AV.txt (74.0 KB)

Hi @miguelfranciscof,

The Java XML parser is throwing because it doesn’t like the file encoding, which appears to be UTF16-LE with a BOM.

However, the file can’t be imported even if it is converted to UTF8 because it isn’t in the expected format. The root element is CoverageDSPriv, whereas the current MS coverage tools produce a coverage file with the root element results.

My guess is that you are using a old version of the MS coverage tools that isn’t supported.

What tools are you using to produce the coverage report, and what version are they?
What command are you running to produce the .coveragexml file?