Your pages will not timeout when you have debug=“true.” It is simply because while debugging you will not really like it that you are in middle of your debugging session and you get an error saying connection timed out or something similar. This attribute allows you to debug your ASP.NET application at your own pace. In the development box this makes sense, but in the production server, long running requests may cause requests to queue and the application to ultimately hang.
Let us check this since it is pretty simple. Ensure that debug=“true” in the web.config file and build the website. Now, open one of the files with .vb extension in your Temporary ASP.NET files folder. In the .vb file, you will find a Public method called New().
Listing 1
Public Sub New() MyBase.New Dim dependencies() As String CType(Me,System.Web.UI.Page).AppRelativeVirtualPath = "~/One.aspx" If (Global.ASP.one_aspx.__initialized = false) Then dependencies = New String(0) {} dependencies(0) = "~/One.aspx" Global.ASP.one_aspx.__fileDependencies = Me.GetWrappedFileDependencies(dependencies) Global.ASP.one_aspx.__initialized = true End If Me.Server.ScriptTimeout = 30000000 End Sub
As you can see above, this temporary .vb file was created for One.aspx. Also notice that ScriptTimeout is set to 30 million seconds which is approximately 347 days! This is the reason why your pages just will not time out while debugging. If you turn debug=false (Figure 5), the .vb files itself are no longer generated and eventually your pages will start expiring as usual. The timeout of the requests are defined by httpRuntime element in your machine.config (for .NET 1.1).
Listing 2
<httpRuntime executionTimeout="90" maxRequestLength="4096" useFullyQualifiedRedirectUrl="false" minFreeThreads="8" minLocalRequestFreeThreads="4" appRequestQueueLimit="100" enableVersionHeader="true" />
In.NET 2.0 the httpRuntime element is not explicitly defined either in the Machine.config file or in the root Web.config file. However, the following settings are the default values as initialized by the system. If you need to customize this section, you must create it in your configuration file and define only those attributes that need customization.
Listing 3
<httpRuntime executionTimeout="110" maxRequestLength="4096" requestLengthDiskThreshold="256" useFullyQualifiedRedirectUrl="false" minFreeThreads="8" minLocalRequestFreeThreads="4" appRequestQueueLimit="5000" enableKernelOutputCache="true" enableVersionHeader="true" requireRootedSaveAsPath="true" enable="true" shutdownTimeout="90" delayNotificationTimeout="5" waitChangeNotification="0" maxWaitChangeNotification="0" requestPriority="Normal" enableHeaderChecking="true" sendCacheControlHeader="true" apartmentThreading="false" />
For details about all the attributes of httpRuntime, please visit this MSDN article.
User Comments