Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3724294
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T06:35:21+00:00 2026-05-19T06:35:21+00:00

We use FxCop’s global suppressions to suppress rule violations found in old code. By

  • 0

We use FxCop’s global suppressions to suppress rule violations found in old code. By old code I mean code that was written sometimes years before we turned on code analysis. We fix violations in new code. We cannot fix the violations in the old code all at once so we use suppressions.

Over time our global suppression files have become bloated. Often when a signature has changed on an old method the prior suppression becomes invalid because it no longer matches up with the code. We created new suppressions to ignore the old violation but often the old SuppressMessage attributes were left behind.

Does anybody know how to identify these SupressMessage declarations that do not match up with code? For that matter does anybody know how to identify SuppressMessage attributes that are invalid because there is no violation to supress?

I am thinking there may be a compiler or FxCopCmd warning or log message that might identify unused suppressions. If not that does anybody know of a script or VS extension that does it?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T06:35:22+00:00Added an answer on May 19, 2026 at 6:35 am

    You can use the stand-alone FxCop UI application for this. Add the “Seen Last Run” column to the “Excluded In Source” results tab. After analysis, this column will show a false value for any in-source suppressions for which a corresponding violation was not found during the analysis run. In order to maximize the reliability of the results, you should ensure that you are using the same set of rule assemblies for the analysis that you use when running the analysis from Visual Studio.

    BTW, if you would like to be able to break your build when “stale” suppressions are found, you might want to consider voting at https://connect.microsoft.com/visualstudio/feedback/details/277253/add-mechanism-for-detecting-unnecessary-suppressmessageattribute-instances.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When you use Visual Studio's code analysic (FxCop), and want to suppress a message
We use FxCop for all of our projects. For our UnitTests I am not
I personally don't use FxCop yet. We want to work out the unit testing
FxCop must base itself on some internal dictionary. Does it use Word dictionaries if
We use a data acquisition card to take readings from a device that increases
Im attempting to use fxCop on a C# Project as kind of basis for
Using FxCop when I try to analyze projects that rely on Patterns and Practices,
I am trying to use the FxCop build runner in TeamCity (5.1.2) and while
I use code belows for dump a specific schema, before dumped it has 4
I want to use a temp directory that will be unique to this build.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.