roslyn.sonaranalyzer.security.cs:S5146 - rules that come from the roslyn rule sets seem to not be able to be disabled by adding the normal pragma statements. It is not unique to this rule, but have seen it on some other roslyn rules too.
#pragma warning disable S5146 // Will be redirecting to unknown URL
Using C# with Visual Studio 2022 and have installed the latest SonarLint extension and shows as a violation in SonarCloud
Appreciate the reply. At least we know why we cannot defeat it with pragmas.
We prefer not to disable on a project or file basis. If there is something flagged we cannot immediately fix because of testing or whatever, we would rather do something to that method to disable it and then add a work item to address it in a future sprint. But when doing it on a more global basis, I feel the problem may be glossed over.
The other problem is consistency. We would like to deal with disabling rules in a consistent manner, rather some rules are done this way and now if that doesn’t work, we need a whole different procedure.