Code Coverage 0 % always

In the Azure DevOps pipeline in the Test task argument, I gave the below arguments
–configuration Release /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --logger trx

Calculating coverage result…
Generating report ‘D:\a\1\s\Bell.Admin.Tests\coverage.opencover.xml’

In Prepare analysis on the SonarCloud task in additional properties, I gave the below properties
extraProperties: |
sonar.exclusions=/obj/,/*.dll
sonar.branch.name=(Build.SourceBranchName) sonar.cs.opencover.reportsPaths=(Build.SourcesDirectory)/
/coverage.opencover.xml
sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)/*.trx

In the sonar cloud.io dashboard, I am not able to see the code coverage %. It always showing me 0 %.
Please help me with the above query.

Hi @Mayank_Rathore,

I haven’t checked the Azure DevOps pipeline behaviour, but from a quick look to your post, it seems that you’re missing a $ sign before some variable names $(Build.SourcesDirectory)

In any case, there will be probably a problem with the path. Can you verify that your Build.SourcesDirectory points to the D:\a\1\s\Bell.Admin.Tests\? I’d expect Bell.Admin.Tests to be a different directory then the main build in usual project structure.