Is it allowed to access SPWeb and specifically SPWeb.ID from PreRequestHandlerExecute ?
Writing an HttpModule [SharePoint2010] and trying to access current web ID using this line of code :
private void context_PreRequestHandlerExecute(object sender, EventArgs e)
{
Guid curID = Microsoft.SharePoint.WebControls.SPControl.GetContextWeb(System.Web.HttpContext.Current).ID;
}
All seems fine but when using the designer, an error is generated :
"soap:ServerServer was unable to process request. ---> Cannot complete this action. Please try again. ---> Cannot complete this action. Please try again."
EDIT : Note that SPContext works fine in PreRequestHandler, it exists and all fields returh the correct values. During QA, we found out that accessing Spweb.ID causes the Desginer to throw an error .. this is disturbing since there might be implications of using SPContext which are not documented at all.