When you use the Visual Studio Code Analyzer (FxCop) and want to suppress the message, there are 3 options.
- Suppression of violation in the code.
- Suppression of violation in the GlobalSupression.cs file.
- Disable violation checking in the project file (via Project β Properties β Code Analysic).
The later version is very difficult to verify when checking on Source Control, and it is difficult to get an overview of all disabled violations. Therefore, we would like to use option 2.
The problem with options 1 and 2 is that you get one line of suppression for each violation. For example, for example:
[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 would like to do something like this GlobalSuppressions.cs:
[assembly: SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes")]
But is it possible?
Thomas Jespersen Sep 16 '08 at 14:21 2008-09-16 14:21
source share