How do you “add the declaration for SPDisposeCheckIgnore to your project?”
I have installed SPDispose and i am getting a number of false positives regarding
SPWeb web = SPContext.Current.Web
;
I want to add [SPDispose开发者_C百科CheckIgnore(SPDisposeCheckID.SPDisposeCheckID_000, "Context Web does not need disposed.")]
You should decorate the method that contains the false positive with the [SPDisposeCheckIgnore]
attribute:
[SPDisposeCheckIgnore(SPDisposeCheckID.SPDisposeCheckID_000,
"Context Web does not need to be disposed.")]
public void YourMethod()
{
SPWeb web = SPContext.Current.Web;
// ...
}
精彩评论