SPC110247: Do not dispose SPWeb returned by SPContext.Current.Web

SPContext objects are managed by the SharePoint framework and should not be explicitly disposed in your code. This is true also for the SPWeb objects returned by SPContext.Web and SPContext.Current.Web

TypeName: DoNotDisposeSPWebCreatedBySPContext
CheckId: SPC110247
Severity: CriticalWarning
Type: AssemblyFileReference
Resolution

Do not dispose SPWeb retrieved by SPContext.Web or SPContext.Current.Web

Remarks

Rule relates to SPDisposeCheckId 'SPDisposeCheckID_220'. To ignore this rule add the attribute '[SPDisposeCheckIgnore(SPDisposeCheckID.SPDisposeCheckID_220, "Caller will dispose")]' to your method.

Links

comments powered by Disqus