Failed to convert code coverage report to XML

Hi

I am working on the integration of SonarCloud with Az DevOps, currently the analysis result is generated, but CodeCoverage.exe tool can not convert my test coverage report file to XML.
Config:

  • .Net Framework
  • Vs Build
  • Vs Test Installed by Tools Installer

I got the following error:
Process returned exit code -1

Coverage report conversion completed successfully.

##[error]Failed to convert the binary code coverage reports to XML. No code coverage information will be uploaded to the server (SonarQube/SonarCloud).

##[error]Check that the downloaded code coverage file (C:\path\filename.coverage) is valid by opening it in Visual Studio. If it is not, check that the internet security settings on the build machine allow files to be downloaded from the Team Foundation Server machine.

Thank you in advance for the help.

Hi,

Welcome to the community!

Unfortunately, this coverage report conversion prior to analysis is outside our scope.

 
Ann

1 Like

Hi, is this some kind of recent change either on part of MS or on part of SQ?

I’m faced with the same error and it seems there’s no way to move forward with this. Or, at least, I’m not sure how I’m supposed to collect code-coverage results when creating a basic .NET-centric build/test DevOps pipeline…

Hi

I have found this stackoverflow page, maybe it helps.

That reply is from… 8 years ago. Since the issue (for us) started to appear only recently, this is very unlikely the cause. :confused:

I’m having the same problem as well since last Thursday 5/23

Starting: Run Code Analysis
==============================================================================
Task         : Run Code Analysis
Description  : Run scanner and upload the results to the SonarCloud server.
Version      : 1.45.0
Author       : sonarsource
Help         : Version: 1.45.0. This task is not needed for Maven and Gradle projects since the scanner should be run as part of the build.

[More Information](https://docs.sonarcloud.io/advanced-setup/ci-based-analysis/sonarcloud-extension-for-azure-devops/)
==============================================================================
C:\a\_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\1.41.0\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe end
SonarScanner for MSBuild 5.15
Using the .NET Framework version of the Scanner for MSBuild
Post-processing started.
Calling the TFS Processor executable...
Attempting to locate the CodeCoverage.exe tool...
VsTestToolsInstallerInstalledToolLocation environment variable detected, seeking for CodeCoverage.exe location...
VsTestToolsInstallerInstalledToolLocation environment variable doesn't contain full path to CodeCoverage.exe tool, seeking in standard place set by VSTestPlatformToolInstaller: C:\a\_tool\VsTest\17.10.0\x64 and tools\net451\Team Tools\Dynamic Code Coverage Tools\CodeCoverage.exe
VsTestToolsInstallerInstalledToolLocation environment variable doesn't contain full path to CodeCoverage.exe tool, seeking in standard place set by VSTestPlatformToolInstaller: C:\a\_tool\VsTest\17.10.0\x64 and tools\net462\Team Tools\Dynamic Code Coverage Tools\CodeCoverage.exe
CodeCoverage.exe found at C:\a\_tool\VsTest\17.10.0\x64\tools\net462\Team Tools\Dynamic Code Coverage Tools\CodeCoverage.exe.
Code coverage command line tool: C:\a\_tool\VsTest\17.10.0\x64\tools\net462\Team Tools\Dynamic Code Coverage Tools\CodeCoverage.exe
Fetching code coverage report information from TFS...
Attempting to locate a test results (.trx) file...
Looking for TRX files in: C:\a\14\TestResults
No test results files found
Did not find any binary coverage files in the expected location.
Falling back on locating coverage files in the agent temp directory.
Searching for coverage files in C:\a\_temp

All matching files: count=4
	C:\a\_temp\a09e3501-8d70-4baa-8f06-c8fa2529a339\AzDevOps_buildvse0015U6_2024-05-28.02_37_21.coverage
	C:\a\_temp\a4e51c3a-97a6-44ba-bc4b-8ef3fc10e707\AzDevOps_buildvse0015U6_2024-05-28.02_37_08.coverage
	C:\a\_temp\AzDevOps_buildvse0015U6_2024-05-28_02_37_08\In\buildvse0015U6\AzDevOps_buildvse0015U6_2024-05-28.02_37_08.coverage
	C:\a\_temp\AzDevOps_buildvse0015U6_2024-05-28_02_37_19\In\buildvse0015U6\AzDevOps_buildvse0015U6_2024-05-28.02_37_21.coverage
Unique coverage files: count=2
	C:\a\_temp\a09e3501-8d70-4baa-8f06-c8fa2529a339\AzDevOps_buildvse0015U6_2024-05-28.02_37_21.coverage
	C:\a\_temp\a4e51c3a-97a6-44ba-bc4b-8ef3fc10e707\AzDevOps_buildvse0015U6_2024-05-28.02_37_08.coverage
Executing file C:\a\_tool\VsTest\17.10.0\x64\tools\net462\Team Tools\Dynamic Code Coverage Tools\CodeCoverage.exe
  Args: analyze /output:C:\a\_temp\a09e3501-8d70-4baa-8f06-c8fa2529a339\AzDevOps_buildvse0015U6_2024-05-28.02_37_21.coveragexml C:\a\_temp\a09e3501-8d70-4baa-8f06-c8fa2529a339\AzDevOps_buildvse0015U6_2024-05-28.02_37_21.coverage 
  Working directory: C:\a\_temp\a09e3501-8d70-4baa-8f06-c8fa2529a339
  Timeout (ms):60000
  Process id: 5888
Microsoft (R) Coverage Collection Tool Version 17.0.24162.516205


Copyright (c) Microsoft Corporation.  All rights reserved.

CodeCoverage.exe is deprecated. Use dotnet-coverage global tool or Microsoft.CodeCoverage.Console instead. Some features of CodeCoverage.exe will be removed in next release of Visual Studio.

Usage: CodeCoverage <command>

Process returned exit code -1
Coverage report conversion completed successfully.
**##[error]Failed to convert the binary code coverage reports to XML. No code coverage information will be uploaded to the server (SonarQube/SonarCloud).**
Check that the downloaded code coverage file (C:\a\_temp\a09e3501-8d70-4baa-8f06-c8fa2529a339\AzDevOps_buildvse0015U6_2024-05-28.02_37_21.coverage) is valid by opening it in Visual Studio. If it is not, check that the internet security settings on the build machine allow files to be downloaded from the Team Foundation Server machine.
**Failed to convert the binary code coverage reports to XML. No code coverage information will be uploaded to the server (SonarQube/SonarCloud).**
Check that the downloaded code coverage file (C:\a\_temp\a09e3501-8d70-4baa-8f06-c8fa2529a339\AzDevOps_buildvse0015U6_2024-05-28.02_37_21.coverage) is valid by opening it in Visual Studio. If it is not, check that the internet security settings on the build machine allow files to be downloaded from the Team Foundation Server machine.
The TFS Processor has finished
Calling the SonarScanner CLI...
INFO: Scanner configuration file: C:\a\_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\1.41.0\classic-sonar-scanner-msbuild\sonar-scanner-4.8.1.3023\bin\..\conf\sonar-scanner.properties
INFO: Project root configuration file: C:\a\14\.sonarqube\out\sonar-project.properties
INFO: SonarScanner 4.8.1.3023