SPC110241: Do not dispose SPSite.RootWeb |
SPC110241: Do not dispose SPSite.RootWeb |
An earlier version of the documentation indicated that the calling application should dispose of the SPSite.RootWeb property just before disposing of the SPSite object that is using it. This is no longer the official guidance. The dispose cleanup is handled automatically by the SharePoint framework.
TypeName: | DoNotDisposeSPSiteRootWeb |
CheckId: | SPC110241 |
Severity: | CriticalWarning |
Type: | AssemblyFileReference |
Do not call Dispose on SPSite.RootWeb. MSDN: An earlier version indicated that the calling application should dispose of the SPSite.RootWeb property just before disposing of the SPSite object that is using it. This is no longer the official guidance. The dispose cleanup is handled automatically by the SharePoint framework. Additionally, SPSite properties LockIssue, Owner, and SecondaryContact used the RootWeb property internally. Given the updated guidance for RootWeb, it is no longer advisable to call the Dispose method on the SPSite.RootWeb property whenever any of these properties are used.
Rule relates to SPDisposeCheckId 'SPDisposeCheckID_655'. To ignore this rule add the attribute '[SPDisposeCheckIgnore(SPDisposeCheckID.SPDisposeCheckID_655, "Caller will dispose")]' to your method.
Copyright © 2013 RENCORE AB. All Rights Reserved
Disclaimer: The views and opinions expressed in this documentation and in SPCAF are those of the creators and do not necessarily reflect the opinions and recommendations of Microsoft or any member of Microsoft. All trademarks, service marks, collective marks, copyrights, registered names, and marks used or cited by this documentation are the property of their respective owners. SharePoint Code Analysis Framework, Version 4.5.2.7855, see www.spcaf.com for more information |