SonarLint & StyleCop in same ruleset file (VisualStudio)

  • Operating system: Windows 10
  • SonarLint plugin version: SonarLint for VisualStudio 2022 (
  • Programming language you’re coding in: C#
  • Is connected mode used:
    • Connected to SonarCloud or SonarQube (and which version): Developer Edition, Version 9.2.3 (build 50713)

In our projects we use SonarLint and StyleCop.
In the same rules file, we have the list of rules for both tools, example

<?xml version="1.0" encoding="utf-8"?>
<RuleSet xmlns:xsd="" xmlns:xsi="" Name="SonarQube - MyProjectName MyQualityProfileName" Description="This rule set was automatically generated from SonarQube https://XXXXX/profiles/show?key=XXXXX" ToolsVersion="14.0">
   <Rules AnalyzerId="SonarAnalyzer.CSharp" RuleNamespace="SonarAnalyzer.CSharp">
     <Rule ... />
     <Rule ... />
   <Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
     <Rule ... />
     <Rule ... />


When I make changes in the SonarQube project configuration (activate/deactivate rules), I have to synchronize the SonarQube project in my VisualStudio project and the rules file is always regenerated, losing the list of existing StyleCop rules.

How can I make sure that this list of StyleCop rules is not lost and that SonarQube respects them when synchronizing?


no suggestion?