How to locally suppress issues while analysis of XML files?

If a C# rule is not “valid” in a specific class it can be disabled locally using SuppressMessageAttribute or #pragma warning ....

How to locally suppressed in XML files?

Hi @lg2de,

See FAQ, try //NOSONAR at the end of the line in the XML file. See if that works for you.


With “//NOSONAR” I can suppress ALL issues on that line.
Is it possible to suppress SINGLE issue for ALL (following) lines in an XML file?


Hello @lg2de ,

In order to remove the issue from a given rule on ALL the lines in XML files, I would recommend you to:

  • disable the rule itself
  • Narrow the focus, and manually exclude the rule for a file, using your project configuration. More here:

Hope this helps,

1 Like