3

I'm interested in creating a custom rule based on CA2000 "Dispose Objects BeforeLosing Scope" in my ASP.Net web project that doesn't apply to objects that are a descendant of System.Web.UI.Control. The reason for this is because calling dispose on web controls doesn't really make sense (see here and here for examples).

Is there a way for me to create a custom rule based on an existing FxCop rule? Or is there a way to get the code for that rule, that I could then tweak to check the type of the object?

Community
  • 1
  • 1
Moskie
  • 1,277
  • 2
  • 16
  • 23

1 Answers1

1

Here are some starting points for you.

http://www.guysmithferrier.com/downloads/fxcop.pdf

http://www.codeproject.com/KB/dotnet/Tool_info_report_FXCOP.aspx

CharithJ
  • 46,289
  • 20
  • 116
  • 131
  • 1
    While that's useful, I've already looked into and have started writing my own FxCop custom rules. The issue here is that I don't want to fully reinvent the wheel, as there exists a built-in rule (CA2000) that is very close to what I want. I'm sure if I attempted to recreate it from scratch, I would do it poorly and probably incorrectly. I would instead like to start with the existing rule and modify it for my project. – Moskie Jun 04 '11 at 04:18