Coverage is 0% for vb.net solution

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube Server / Community Build, Scanner, Plugin, and any relevant extension)
  • how is SonarQube deployed: Docker
  • what are you trying to achieve - Need coverage %
    • what have you tried so far to achieve this -following configuration -TestSmartClient:
      extends: .NetFrameworkJob
      stage: test
      needs:

      • job: BuildSmartClient
        artifacts: false
        allow_failure: true
        script:
      • cd DotNet\SmartClient
      • nuget restore SmartClient.sln
      • $env:SONAR_SCANNER_OPTS=“-Dhttps.proxyHost=10.56.25.5 -Dhttps.proxyPort=3128 -Dhttp.proxyHost=10.56.25.5 -Dhttp.proxyPort=3128 -Djava.net.useSystemProxies=false”

      if ($Env:CI_PIPELINE_SOURCE -eq “merge_request_event”) {
      Write-Host “Configuring SonarQube for Merge Request context…”
      SonarScanner.MSBuild.exe begin /k:integrale.planning.smartclient
      /v:IPMR2611A /d:sonar.verbose=true
      /d:sonar.host.url=hostAddress /d:sonar.token=${SONAR_TOKEN}
      /d:https.proxyHost="Address" /d:https.proxyPort=XXXX

    • /d:java.net.useSystemProxies=false /d:sonar.pullrequest.key=$Env:CI_MERGE_REQUEST_IID
      /d:sonar.pullrequest.branch=$Env:CI_MERGE_REQUEST_SOURCE_BRANCH_NAME /d:sonar.pullrequest.base=$Env:CI_MERGE_REQUEST_TARGET_BRANCH_NAME } else { Write-Host "Configuring SonarQube for standard branch tracking stream..." SonarScanner.MSBuild.exe begin
      /k:integrale.planning.smartclient /d:sonar.branch.name=$Env:CI_COMMIT_BRANCH
      /v:IPMR2611A /d:sonar.verbose=true
      /d:sonar.host.url=“host address

    • /d:sonar.token=${SONAR_TOKEN}
      /d:https.proxyHost=“Address”

    • /d:https.proxyPort=xxxx

    • /d:java.net.useSystemProxies=false
      }

      - msbuild /t:Rebuild SmartClient.sln -p:Configuration=Debug /p:SignManifests=True /p:ManifestCertificateThumbprint=$pfxThumbprint /p:ManifestTimestampUrl="http://timestamp.digicert.com"
      - .\packages\OpenCover.4.7.1221\tools\OpenCover.Console.exe "-target:.\packages\NUnit.ConsoleRunner.3.19.2\tools\nunit3-console.exe" "-targetargs:.\_Build\Debug\Worldline.Transport.Integrale.NUnit.dll" "-register:user" "-output:opencover.xml"
      - SonarScanner.MSBuild.exe end /d:sonar.token=${SONAR_TOKEN}
      

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!

Hey @Shekhar_Kulkarni, welcome to the Community!

Most commonly, coverage problems are caused because the Scanner isn’t finding the coverage report file. Debug-level logs may help diagnose this. I see you are already running the Scanner with debug logs (passing /d:sonar.verbose=true to the begin step). Do you see any errors or warnings in the logs? Usually you would be looking for:

  • Evidence that the coverage report is being found (Parsing the OpenCover report)
  • Evidence that it isn’t found (WARN: Could not find any coverage report file matching the pattern)
  • Other problems parsing the coverage report (WARN: The Code Coverage report doesn’t contain any coverage data for the included files., or perhaps DEBUG: Skipping file with path)

Other than that, I also encourage you to save the coverage report as a build artifact, download it and inspect it, to see if it indeed is reporting coverage for your project files, if it’s empty, if the file paths in the report don’t match your project’s file paths…