FYI, I’ve combined your topics since they seem to be the same.
Regarding your actual question I need to start with the reminder that 7.9.* is no longer the LTS. SonarQube 8.9 was released last week, and it’s the new/current LTS. (Sorry to be pedantic. )
To add Roslyn rules to your analysis, simply let them run as part of you’re build; they’ll be picked up automatically. You can get more details at the bottom of this docs page:
Issues from third-party Roslyn analyzers (including Roslyn analyzers provided by Microsoft) are included in the MSBuild output and imported by default into SonarQube so no properties exist to enable that behavior…
We referenced StyleCop analyzers in all the projects that need the rules to implement and then ran SonarQube analysis from Visual Studio. Then SonarQube automatically imported those issues when it scans those projects. But when we try from Azure DevOps build pipeline (SonarQube analysis is one of the task), StyleCop issues are not imported when it scans the projects.
hello @shasi - external analyzer reports should be picked up automatically by the scanner for .NET / Azure Devops Extension
You need to reference these analyzers in your CSPROJ / VBPROJ files (or a common Directory.build.props used by all projects) and they will be picked up by MSBuild and executed during the build. Our scanner reads out of the box the build analysis output and uploads them to SQ/SC.
We are using StyleCop.Analyzers in our CI (with SonarCloud integration - it works the same for SonarQube) and results are correctly imported to SonarCloud. Check: