Sonar rule warnings shown in Azure Pipeline build logs despite successful Quality Gate

Versions

  • SonarQube Server Data Center Edition v2026.1.2 (121356)
  • SonarScanner for .NET 11.2.1
  • Using the .NET Framework version of SonarScanner for .NET
  • Azure DevOps Pipelines
  • Mixed solution containing .NET Framework 4.8 and .NET 10 projects

Deployment

  • SonarQube Data Center Edition

What are you trying to achieve?

We are using SonarQube PR analysis in Azure DevOps and have configured incremental PR analysis.

The Quality Gate passes successfully

We would like to understand whether it is possible to avoid Sonar rule warnings appearing in the Azure DevOps MSBuild output while still keeping:

  • SonarQube analysis enabled
  • PR analysis enabled
  • Quality Gate enforcement enabled
  • Sonar rules active

What have you tried so far?

  • Configured PR analysis
  • Configured incremental analysis
  • Configured file exclusions
  • Configured issue exclusions using sonar.issue.ignore.multicriteria

During preprocessing we can see:

Installing required Roslyn analyzers...
Processing plugin: securitycsharpfrontend
Processing plugin: csharpenterprise


During the MSBuild step we still see Sonar rule warnings such as:

warning S4136: All method overloads should be adjacent
warning S1699: Remove this call from a constructor to the overridable method

The Quality Gate passes, but the warnings still appear in the Azure DevOps build logs.

Question

Is this expected behaviour when using SonarScanner for .NET?

Are these warnings being produced directly by the Roslyn analyzers during compilation, and if so, is there a supported way to prevent these Sonar rule warnings from appearing in the MSBuild output without disabling the rules in the Quality Profile?

Hey @fenildesai, welcome to the Community!

Yes, this is expected with SonarScanner for .NET. The active Sonar rules run as Roslyn analyzers during the MSBuild step, so their warning Sxxxx diagnostics are naturally written to the Azure DevOps build log. A successful Quality Gate does not suppress those compiler-time diagnostics.

sonar.issue.ignore.multicriteria and sonar.exclusions affect which issues are retained/sent to SonarQube after the build; they do not prevent the Roslyn analyzer from executing or emitting warnings during compilation.

There is no supported configuration to hide only Sonar warnings while leaving the associated rules enabled and collecting their issues. -clp:ErrorsOnly can reduce the console output, but it also hides all other warnings and most normal build output.