Hi Team,
-I’m facing an issue while trying to import Visual Studio coverage into SonarQube during Azure DevOps pipeline execution.
-Scanner**: Azure DevOps SonarQubePrepare@7 / SonarScanner for MSBuild
-Build agent OS: Windows-2019
-Language**: C#
-Project Type**: .NET Framework (not .NET Core)
-Coverage Tool**: Visual Studio’s CodeCoverage.exe (converted .coverage
to .coveragexml
)
-Problem Details:
-My pipeline generates .coveragexml
successfully.
-I pass the path in extraProperties
of SonarQubePrepare
like:
-extraProperties: |
sonar.cs.vscoveragexml.reportsPaths=$(Build.ArtifactStagingDirectory)\CoverageXmlDebug***.coveragexml.
-During analysis, I see the file is found and parsed:
INFO: Parsing the Visual Studio coverage XML report D:\a\1\a\TestResults\...\*.coveragexml
-BUT:
WARN: The Code Coverage report doesn't contain any coverage data for the included files.
-Troubleshooting already done:
.pdb
files are present during test run and coverage generation.- Coverage is generated after test execution, before SonarQubeAnalyze.
- Build is done with
/p:DebugType=full /p:DebugSymbols=true
. - No manual deletion of
.pdb
files before coverage. .coveragexml
path matches the source files path reported by Sonar scanner (D:\a\1\s\
)..coveragexml
file opens correctly in Visual Studio.