Hi,
i am getting the below error while deactivating the feature in sharepoint 2010
system.security. securityexception was unhandled by user code message=access denied
the code is
public override void FeatureDeactivating(SPFeatureReceiverProperties properties)
{
SPSite site = properties.Feature.Parent as SPSite;
SPSecurity.RunWithElevatedPrivileges(delegate()
{
using (SPSite _site = new SPSite(site.ID, SPUserToken.SystemAccount))
{
SPWebApplication webApp = _site.WebApplication;
if
(null != webApp)
{
if (webApp.UpdateMappedPage(SPWebApplication.SPCustomPage.AccessDenied, null))
{
webApp.Update();
}
}
}
});
}
}
can any one give the solution for it
Thanks,
Lilu