Currently I'm experiencing an issue with SPLongOperation in SharePoint 2013. I have some custom logic which takes at least 15 minutes to process and therefore I use a SPLongOperation to make sure it's not timing out after 6 minutes. In the past this piece of code worked on SharePoint 2010. The problems is that the code execution stops exactly after 6 minutes. With debugger attached it doesn't timeout, so somehow the SPLongOperation block is ignored or not working correctly. The code I use to call the SPLongOperation is as follows:
using (SPLongOperation operation = new SPLongOperation(Page))
{
try
{
operation.LeadingHTML = html; //adding some custom html...
operation.Begin();
// Business Logic
}
finally
{
operation.End("/page.aspx", SPRedirectFlags.RelativeToLayoutsPage, Context, string.Empty);
}
}
The behavior I see at several machines with this piece of code is that after 6 minutes a Timeout occurs with the following exception in ULS: System.Web.HttpException: Request timed out. Has anyone an idea what might be the problem? I'm using SharePoint 2013 with October CU installed on it. I also tested this block using a while(true) statement to make sure the business logic is not causing the problem.