Sometimes we use SharePoint application pages or web parts to perform heavy operations those take long time than usual. In that case we have to explicitly increase the timeout periods using the Web.Config file.
Recently I came across a similar situation where an application page is used to create site collections using custom definitions.To resolve the error I modified the Web.Config file of the relevant web application and provided following values.
- <httpRuntime maxRequestLength="2097152" executionTimeout="1500" requestLengthDiskThreshold="8192" shutdownTimeout="108000" />
Unfortunately that remedy didn’t work.
After few hours of struggling it occurred to me that I was modifying the wrong Web.Config file. Since my page is located in Layouts folder, the page is not directly bound to a specific web application. For these kind of situations we are provided with a different Web.Config file, which is located under the Layouts folder.
I had to do following modification to increase the timeout period under system.web section
- <httpRuntime executionTimeout="1500" />
That fixed my issue.