using (var web = SPContext.Current.Site.RootWeb)
{
//Some code
}
The SPDisposeCheck tool is telling me not to dispose of this object - but I thought this was a prime example of where you should dispose of an SP object!?
Output from SPDisposeCheck:
Notes: Dispose should not be called on this object. Initial Assignment: web := Microsoft.SharePoint.SPContext.get_Current().{Microsoft.SharePoint.SPContext}get_Site().{Microsoft.SharePoint.SPSite}get_RootWeb()
The SPContext object live for the whole life cycle of the request. If you dispose it's inner Web or Site property, you will break other SharePoint components that may request this properties later in the life of the request.
To be simple, only dispose Web and Site you created. Not ones managed by SharePoint engine.
PS: did you considered to post on http://sharepoint.stackexchange.com ?