Roslyn rule excluded by “nowarn” still appearing in Sonar

I am using SonarQube 9.9.0.65466 and I have a C# project integrated via Azure DevOps and a git repo. In this particular project, I have a Roslyn analyzer configured. One of the rules, CS1591, I have configured via the dotnet build /nowarn command switch so the rule (XML comments) will be ignored. If you review the output of the build step from dotnet build, the rule is not processed and does not appear as a warning. However, within SonarQube, there are issues created for each instance (and a comment applied to the PR), despite the fact that the build suppressed the warning and it did not appear in the output of the build. Is there a way that I can get this rule suppressed within SonarQube?

Hey there.

I found this GitHub issue while researching the problem.

Do you have some .ruleset configuration turning this rule on? What version of Visual Studio / DotNet are you using?

That’s very odd, as there’s no other way for SonarQube to know about the issue other than the build output.

We had an .editorconfig file entry to lower it from warning to suggestion. Even when I removed and re-analysed it, it still reports these issues in SonarQube. I also tried to delete the branch in SonarQube and re-process it, but the XML issues still appear. The build output from MSBuild doesn’t show any output related to this warning at all.