SPDispose gives error Disposable type not disposed Microsoft.SharePoint.SPSite ***This may be a false positive depending on how the type was created or if it is disposed outside the current scope when run with eleveted privilage is used. here is the code:
SPSecurity.RunWithElevatedPrivileges(delegate()
{
SPWebApplication webAppContext = properties.Feature.Parent as SPWebApplication;
site = webAppContext.Sites[0];
userToken = site.SystemAccount.UserToken;
});
/* End: 003 */
/* Start: 001 */
using (SPSite siteColl = new SPSite(site.ID, userToken))
{
SPWebApplication webApp = siteColl.WebApplication;
if (null != webApp)
{
if (webApp.UpdateMappedPage(SPWebApplication.SPCustomPage.AccessDenied, Constant.customAccessDeniedPage))
{
webApp.Update();
}
}
}