I have a page that takes a few minutes to run. When I set debug="false"
in the <compilation />
tag in web.config, I get a "Request timed out." error (and internal try/catch blocks in my code get a "Thread was being aborted." error.
What is the fix to allow long pages to run in production mode? Does debug mode have an infinite timeout?
You should just need to increase the script timeout for page executions. It defaults to 90 seconds, so if you need more time, change it in the following system.web element (executionTimeout attribute):
<httpRuntime executionTimeout="seconds"
maxRequestLength="kbytes"
minFreeThreads="numberOfThreads"
minLocalRequestFreeThreads="numberOfThreads"
appRequestQueueLimit="numberOfRequests"
useFullyQualifiedRedirectUrl="true|false" />
You can set the max. duration for requests in web.config:
<system.web>
...
<httpRuntime executionTimeout="600" />
Where executionTimeout specifies the maximum number of seconds that a request is allowed to execute before being automatically shut down by ASP.NET. Details can be found here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With