C#C
C#3y ago
tariel36

How to suppress all errors and warnings within namespace (or directory) using GlobalSuppressions.cs

I have a directory with generated API client code and it does not match coding standards configured within the solution. I would like to ignore all errors and warnings withing namespace or directory.

So far I tried the following code which is supposed to ignore multiple blank lines, but it doesn't work.
[assembly: SuppressMessage("Style", "IDE2000:Avoid multiple blank lines", Justification = "Autogenerated code", Scope= "namespaceanddescendants", Target = "~N:the.root.namespace.of.generated.code")]

I also tried the namespace with actual code within it, so for example as below but still doesn't work. How to do it correctly?

[assembly: SuppressMessage("Style", "IDE2000:Avoid multiple blank lines", Justification = "Autogenerated code", Scope= "namespaceanddescendants", Target = "~N:the.nested.namespace.of.generated.code")]
Was this page helpful?