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?
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.
Did you try modifying your .editorconfig to set the severity to none?
If you want to keep the issue as info for local development, you can write a small script that will search/replace the value in the config file during your CI build with none.
I wanted to close the loop on this. I wasn’t able to do anything within Sonar, but I was able to pass a parameter to MSBuild --property:GenerateDocumentationFile=false that prevented this particular issue from occurring.