.net - Can I suppress FX Cop code analysis violations globally? -
when use visual studio's code analysic (fxcop), , want suppress message there 3 options.
- suppress violation in code.
- suppress violation in globalsupression.cs file.
- 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
Post a Comment