How to set parameters for C# Roslyn rules?

Hi,

I am working with SonarQube 7 LTS as we want to upgrade from version 5 to 7, and recently imported custom C# rules by using the Roslyn SDK.
They appear on my rules page, so I can add them to my custom quality profile, but I can’t set any parameters for the rules. In SonarQube 5.6, using the identical rules, I could even set different rule parameters for each quality profile (see screenshot below). In SonarQube 7, i can only change the Severity.
I tried exporting the quality profile from version 5.6, where each of these rules have their respective parameters in the .xml file (example below). But those parameters are being ignored when importing to version 7. So, how to change the rule parameters for SonarQube 7?

<rule>
      <repositoryKey>...</repositoryKey>
      <key>...</key>
      <priority>INFO</priority>
      <parameters>
        <parameter>
          <key>max</key>
          <value>25</value>
        </parameter>
      </parameters>
    </rule>

rule_params_sonar5

  • SonarQube 7 LTS
  • SonarQube Roslyn SDK 2.0
  • SonarScanner for MSBuild 4.8

Solved. Syntax was incorrect. Correct syntax for parameters:

<param>
    <key>max</key>
    <description> <![CDATA[Threshold value]]> </description> 
    <type>INTEGER</type> 
    <defaultValue>0</defaultValue> 
</param>