Not able to generate code coverage with opencover for .NET application

not able to generate code coverage with opencover for .NET application

Hey there.

SonarCloud only reads coverage reports – it isn’t responsible for producing them. Are you successfully generating code coverage reports today, and taken the steps to import them?

am using on-prem sonar
i wrote one powershell script , could you please help me to understand.

$Folder = “D:\agent_work\145\s”
$TestDlls = Get-ChildItem -Path $Folder -Filter “NUnitTest.dll” -Recurse
$VSTestArgs = @()
foreach ($TestDll in $TestDlls) {
$VSTestArgs = $VSTestArgs + $TestDll.FullName
}
$VSTestArgs = $VSTestArgs + ‘/TestAdapterPath:“D:\nUnit\NUnit3TestAdapter-4.0.0\build\net35”’
write-host $VSTestArgs
& “C:\Users\Sridhar.Ravula\AppData\Local\Apps\OpenCover\OpenCover.Console.exe” -target:“C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\TestWindow\VSTest.Console.exe” -targetargs:"$VSTestArgs" -output:"$(build.artifactstagingdirectory)\CoverageResults.xml" -register:user

and in the coverage report, i can see some pdb files are missing
and the below error

InnerException: System.IO.FileNotFoundException: Could not load file or assembly ‘nunit.framework, Version=3.10.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb’ or one of its dependencies. The system cannot find the file specified.
2022-01-27T19:49:27.9072574Z File name: ‘nunit.framework, Version=3.10.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb’

am new to .net sonarqube integration, please help me on this