In general, the mapping can indeed be changed in a few ways:
- You can manually override the severity in the ruleset file
- You can reference a different ruleset that overrides the severity
- You can enable “treat warnings as errors” VS feature (Project properties --> build --> treat warnings as errors)
The numbers that you provided don’t seem to match the “treat warnings as errors”, so something else is causing the discrepancy.
To rule out that it’s not due to manual change, please try to re-bind your project and see if that helps.
If it still happens after the binding, please check the following:
- Does the generated ruleset file (under
.sonarlint folder in your solution) contain the correct mapping?
- Does your project reference that ruleset, or some other ruleset? (check the CodeAnalysisRuleSet property in your csproj)