Unable to Report Code Coverage Using Native GitHub Integration (for .NET)

Hello,

We are using SonarCloud’s native GitHub integration to automatically analyze all of our pull requests.
Our primary language and build environment is .NET (C#), and the integration works well for code quality and issue detection.

However, we are currently unable to report code coverage results when using this native integration approach.
We’ve reviewed the documentation and various community threads but could not find a clear method for publishing or passing coverage reports when the analysis is triggered automatically by the GitHub integration.

Is there a supported way to report .NET code coverage results when using the native GitHub Integration (without switching to manual sonar-scanner usage)?

Hey there.

I assume you mean that you’re using Automatic Analysis. If that’s the case – code coverage import is not available. As noted in the docs:

Code coverage information is not supported.

To get that info, you’d need to swtich to CI-based analysis (using the SonarScanner for .NET, not the SonarScanner CLI (sonar-scanner)

Using the SonarScanner for .NET + GitHub Actions is well documented under your project’s Administration > Analysis Method > With GitHub Actions > .NET

Also checkout the docs on .NET Test Coverage.