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

  • SEARCH
  • Home
  • 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 836411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:58:36+00:00 2026-05-15T04:58:36+00:00

Running FxCop on a WebProject that contains a UserControl will result in a CA2000

  • 0

Running FxCop on a WebProject that contains a UserControl will result in a CA2000 Warning (Call System.IDisposable.Dispose on object) for every ServerControl (Label, TextBox,…) in that UserControl.

I understand why this would happen.
Replacing the ‘offending’ ServerControls with a PlaceHolder and then adding the Controls in code (Using…End Using) might be a way around that, but it is not always an option.
But, if they are not ‘kosher’ why have ServerControls you can drop in your ascx/aspx in the first place ?
Am I missing something ?

If, like in my case, you inherit a sizeable collection of fairly complex UserControls, do I now add every ‘offending’ Control to the GlobalSupperssions file (that’s a lot of mind numbing right-clicking) ?
I do not want to suppress all CA2000 warnings since it makes perfect sense to fix them, but not in the case of ServerControls in UserControls.

  • 1 1 Answer
  • 2 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-15T04:58:36+00:00Added an answer on May 15, 2026 at 4:58 am

    Hmya, everybody really likes a tool that will tell them that they forgot to call Dispose(). Problem is: such a tool is really hard to implement. The specific warning you are talking about got disabled and re-enabled a few times now.

    Obviously the warning you got is nonsense, a UserControl already knows how to properly dispose its member controls. It is just not something that an automated tool can easily detect. The dispose call is a million miles removed from the constructor call, buried in .NET framework code with a couple of virtual methods and event handlers thrown in the mix.

    To really evaluate those warnings, you’ll have to switch to another tool: the one between your ears.

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

Sidebar

Related Questions

I'm currently going through the process of running FxCop through our application that has
Running this in python will result in a WindowsError stating it cannot find the
I am running static code analysis with FxCop 1.36 and I keep getting warning
Running FxCop on my code, I get this warning: Microsoft.Maintainability : 'FooBar.ctor is coupled
I get the following error when running FXCop: CA1800 : Microsoft.Performance : 'obj', a
I'm running some code through FxCop and am currently looking at clearing all of
Running my script through Devel::NYTProf showed that the following portion of code took up
Running SQL Server 2008 (not R2). I have a few reports that have URLs
does anyone know how to or can provide the syntax for running FxCop via
After running Code Analysis in VS2010 beta (FxCop for previous versions) I'm getting the

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.