Search code examples
visual-studio-2012code-analysisfxcop

How do I get a list of suppressed code analysis warnings from a visual studio project?


I have enabled code analysis for all the projects in a solution. To overcome various code analysis warnings the code contains numerous code suppression attributes (System.Diagnostics.CodeAnalysis.SuppressMessage). I want to get a list of these suppression attributes. I want this list so that I can see if the suppression is still needed and check that we have suitable justifications specified.

Does anyone have or know of a good method/plugin/tool to get a list/report of suppressed code analysis warnings from a visual studio project/solution?


Solution

  • Edit -> Find and Replace -> Find in Files, or default shortcut Ctrl+Shift+F.

    Just tell it to search for SuppressMessage in the entire solution. It will drop all of the results with their file locations into a dialog, which you can copy/paste into your viewer/editor of choice.