Not getting code coverage for .net framework solution

Hi Team,

I am using sonar cloud analysis for the .net framework(version 4.7.2) solution in the azure devops pipeline. code is getting analyzed and publishing results properly but code coverage shows always 0%.

For the .net core solution, Dotnet test task help generate coverage report and sonar publishes them.

I have tried VsTest & Dotnet test tasks for framework solutions but no luck. Please let me know if there is any solution available for this.

Hey there.

You aren’t giving us too much to go off here – can you share your pipeline configuration (or the various ones you’ve tried) and the log output?

@collin please find detailed steps below

  1. For the .net framework solution following the steps do not work.
    image

Logs:

  1. For .net core following steps work as expected.

Please let me know if anything else is needed here.

It looks like your issue is more with the VSTest task (which indicates no test results are being published), rather than with SonarCloud analysis. I would suggest making sure your report is generated correctly, and then worry about getting it into SonarCloud.