开发者

Creating a Custom FXCop Rule based on CA2000 "Dispose Objects Before Losing Scope" that doesn't apply to System.Web.UI.Control objects

开发者 https://www.devze.com 2023-03-10 03:00 出处:网络
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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消