.net - Can I suppress FX Cop code analysis violations globally? -


when use visual studio's code analysic (fxcop), , want suppress message there 3 options.

  1. suppress violation in code.
  2. suppress violation in globalsupression.cs file.
  3. disable violation check in project file (via project -> properties -> code analysic).

the later hard review when checking in source control, , hard overview of disabled violations. use option 2.

the problem option 1 , 2 1 suppression line each violation. e.g like:

[assembly: suppressmessage("microsoft.design", "ca1020:avoidnamespaceswithfewtypes", scope = "namespace", target = "company.project.namespace2")] [assembly: suppressmessage("microsoft.design", "ca1020:avoidnamespaceswithfewtypes", scope = "namespace", target = "company.project.namespace1")] 

we love ing globalsuppressions.cs:

[assembly: suppressmessage("microsoft.design", "ca1020:avoidnamespaceswithfewtypes")] 

but possible?

suppressing multiple violations single suppressmessage attribute officially not supported. apparently, design.

i agree, might annoying @ times, can't disagree decision, since attribute way force say, "yes, know doing", should evaluated in case-by-case basis.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -