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 th开发者_如何学Ce object?
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
精彩评论