[error]Failed to convert the downloaded code coverage tool to XML

Is there any way to increase the timeout for code coverage file conversion?

I get the following error when running SonarCloud analysis for a .NET 4.5 project in an Azure DevOps pipeline:

Calling the TFS Processor executable...
Attempting to locate the CodeCoverage.exe tool...
Attempting to locate the CodeCoverage.exe tool using setup configuration...
Multiple versions of VS are installed: 16.11.32126.315, 15.9.28307.1800
Code coverage command line tool: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\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: T:\agents\_work\1\TestResults
The following test results files were found: T:\agents\_work\1\TestResults\tfsbuild_buildsvr_2022-05-19_13_25_41.trx, T:\agents\_work\1\TestResults\tfsbuild_buildsvr_2022-05-19_13_45_36.trx
Absolute path to coverage file: T:\agents\_work\1\TestResults\tfsbuild_buildsvr_2022-05-19_13_25_41\In\buildsvr\tfsbuild_buildsvr_2022-05-19.13_25_09.coverage
Absolute path to coverage file: T:\agents\_work\1\TestResults\tfsbuild_buildsvr_2022-05-19_13_45_36\In\buildsvr\tfsbuild_buildsvr_2022-05-19.13_44_59.coverage
The following code coverage attachments were found from the trx files: T:\agents\_work\1\TestResults\tfsbuild_buildsvr_2022-05-19_13_25_41\In\buildsvr\tfsbuild_buildsvr_2022-05-19.13_25_09.coverage, T:\agents\_work\1\TestResults\tfsbuild_buildsvr_2022-05-19_13_45_36\In\buildsvr\tfsbuild_buildsvr_2022-05-19.13_44_59.coverage
Not using the fallback mechanism to detect binary coverage files.
Executing file C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Team Tools\Dynamic Code Coverage Tools\CodeCoverage.exe
  Args: analyze /output:T:\agents\_work\1\TestResults\tfsbuild_buildsvr_2022-05-19_13_25_41\In\buildsvr\tfsbuild_buildsvr_2022-05-19.13_25_09.coveragexml T:\agents\_work\1\TestResults\tfsbuild_buildsvr_2022-05-19_13_25_41\In\buildsvr\tfsbuild_buildsvr_2022-05-19.13_25_09.coverage 
  Working directory: T:\agents\_work\1\TestResults\tfsbuild_buildsvr_2022-05-19_13_25_41\In\buildsvr
  Timeout (ms):60000
  Process id: 16556
WARNING: Timed out after waiting 60000 ms for process C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Team Tools\Dynamic Code Coverage Tools\CodeCoverage.exe to complete: it has been terminated, but its child processes may still be running.
Coverage report conversion completed successfully.
##[error]Failed to convert the downloaded code coverage tool to XML. No code coverage information will be uploaded to SonarQube.
Failed to convert the downloaded code coverage tool to XML. No code coverage information will be uploaded to SonarQube.
##[error]Check that the downloaded code coverage file (T:\agents\_work\1\TestResults\tfsbuild_buildsvr_2022-05-19_13_25_41\In\buildsvr\tfsbuild_buildsvr_2022-05-19.13_25_09.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.
Check that the downloaded code coverage file (T:\agents\_work\1\TestResults\tfsbuild_buildsvr_2022-05-19_13_25_41\In\buildsvr\tfsbuild_buildsvr_2022-05-19.13_25_09.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

I have opened the .coverage file in Visual Studio and it is valid. This is a large solution (3.5M LoC), so is it juts taking too long becasue of the size of the coverage file?

Hi @GlenHarding,

WARNING: Timed out after waiting 60000 ms for process C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Team Tools\Dynamic Code Coverage Tools\CodeCoverage.exe to complete: it has been terminated, but its child processes may still be running.

It looks to me that CodeCoverage.exe times out while processing the file. This tool is provided by Microsoft and not on our control. We call it to convert the coverage to a format readable by our analyzer.

As an alternative you could try to follow the guide from .NET Test Coverage | SonarCloud Docs and use the dotnet-coverage tool.