CodeCoverage.exe is deprecated

Must-share information (formatted with Markdown):

  • which versions are you using SonarQube 10.1, SonarScanner for MSBuild 5.13, Task SonarQubeAnalyze@5
  • how is SonarQube deployed: zip
  • what are you trying to achieve
    Using MSTest, the test have been executed
dotnet.exe test XXX.Test.csproj --logger trx --results-directory E:\_1\_temp -c release --filter TestCategory!=IntegrationTest --collect "Code coverage"

In Tast SonarQubeAnalyze the coverage files are converted automatically, a warning is issued:

Executing file C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Team Tools\Dynamic Code Coverage Tools\CodeCoverage.exe
Args: analyze /output:E:_1_temp\009aebb3-a793-4e86-8d75-6c77d6f86277\268e86a0-2b05-4034-a6b0-997c9e98f27e.coveragexml E:_1_temp\009aebb3-a793-4e86-8d75-6c77d6f86277\268e86a0-2b05-4034-a6b0-997c9e98f27e.coverage
Working directory: E:_1_temp\009aebb3-a793-4e86-8d75-6c77d6f86277
Timeout (ms):60000
Process id: 5244
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.

Hi Volker

Thanks for sharing this. We do now support the suggested alternative dotnet-coverage, and if you are using the dotnet CLI it’s a nice tool. You can see how to set it up in our documentation here.

Tom

Thanks @Tom_Howlett

we are using the Azure DevOps Extension, I assumed that would be recognized by the task SonarQubeAnalyze@5 in the report.

According to your documentation there is run CodeCoverage.exe automatically - and this result in the reported warning…

By the way: why do I need (according to your documentation) need to install a dotnet global tool? TUsually, we use dotnet local tools which can be restored on any workstation to get compareable setup.

Yes, we need to take a look at the Scanner for .NET which will run CodeCoverage.exe automatically if it can.

You can install dotnet tool locally too. I’ll update the documentation on this point.

Thanks

Tom

Hello @milbrandt,

I have opened this issue on the scanner for dotnet repository. We plan to change our logic and look for alternative tools first if they are available.

Best,
ÄŚaba

Thanks, I added the proposal that the scanner will install dotnet-coverage as local tool on its own. Then the scanner would not rely on some external tool which might not be installed on a build agent.

Hi,

We are using Azure pipeline task “SonarCloudAnalyze@1” on a Microsoft hosted agent but we still see this warning:
“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.”

The task prints these versions:
INFO: SonarScanner 4.8.1.3023
INFO: Java 17.0.9 Eclipse Adoptium (64-bit)
INFO: Windows Server 2022 10.0 amd64

Do we have do do something so we don’t see this warning?

Best Regards,
Anders Havn