httpRuntime Element (ASP.NET Settings Schema)

Configures ASP.NET HTTP run-time settings that determine how to process a request for an ASP.NET application.

<httpRuntime
   executionTimeout = "HH:MM:SS" 
   maxRequestLength = "number" 
   requestLengthDiskThreshold = "number" 
   useFullyQualifiedRedirectUrl = "[True|False]" 
   minFreeThreads = "number" 
   minLocalRequestFreeThreads = "number" 
   appRequestQueueLimit = "number"
   enableKernelOutputCache = "[True|False]" 
   enableVersionHeader = "[True|False]" 
   apartmentThreading = "[True|False]"
   requireRootedSaveAsPath = "[True|False]"
   enable = "[True|False]" 
   sendCacheControlHeader = "[True|False]" 
   shutdownTimeout = "HH:MM:SS"
   delayNotificationTimeout = "HH:MM:SS"
   waitChangeNotification = "number" 
   maxWaitChangeNotification = "number" 
   enableHeaderChecking = "[True|False]" 
/>

Attributes and Elements

The following sections describe attributes, child elements, and parent elements.

Attributes

Attribute Description

apartmentThreading

Optional Boolean attribute.

Enables apartment threading for classic ASP compatibility.

This attribute is new in the .NET Framework version 2.0. The default is False.

appRequestQueueLimit

Optional Int32 attribute.

Specifies the maximum number of requests that ASP.NET queues for the application. When there are not enough free threads to process a request, the requests are queued. Incoming requests are rejected with the error "503 - Server Too Busy" when the queue exceeds the limit that is specified in this attribute.

The default is 5000.

Note

For the .NET Framework versions 1.0 and 1.1, the default is 100.

delayNotificationTimeout

Optional TimeSpan attribute.

Specifies the time-out for delaying notifications.

This attribute is new in the .NET Framework version 2.0.

The default is "00:00:05" (5 seconds).

enable

Optional Boolean attribute.

Specifies whether the application domain (AppDomain) is enabled to accept incoming requests at the current-node and child-node level. If False, the application is effectively turned off.

The default is True.

enableHeaderChecking

Optional Boolean attribute.

Specifies whether ASP.NET should check the request header for potential injection attacks. If an attack is detected, ASP.NET responds with an error.

This attribute is new in the .NET Framework 2.0.

The default is True.

enableKernelOutputCache

Optional Boolean attribute.

Specifies whether output caching is enabled. This attribute is only relevant when Microsoft Internet Information Services (IIS) 6.0 or later is installed. The output caching configuration and type of request determines whether content can be cached.

To cache a response, the following criteria must be met:

  • Caching must be explicitly enabled by a page directive or by using the caching API.

  • Caching must have an expiration policy so that the kernel recognizes when to discard the response.

  • Caching does not have any variable headers or parameters.

  • Authentication is not required.

The default is True.

enableVersionHeader

Optional Boolean attribute.

Specifies whether ASP.NET should output a version header. This attribute is used by Microsoft Visual Studio 2005 to determine which version of ASP.NET is in use. It is not necessary for production sites and can be disabled.

Note

This attribute is not available in the .NET Framework 1.0.

The default is True.

executionTimeout

Optional TimeSpan attribute.

Specifies the maximum number of seconds that a request is allowed to execute before being automatically shut down by ASP.NET.

This time-out applies only if the debug attribute in the compilation element is False. To help to prevent shutting down the application while you are debugging, do not set this time-out to a large value.

The default is "00:01:50" (110 seconds).

Note

In the .NET Framework 1.0 and 1.1, the default is 90.

maxRequestLength

Optional Int32 attribute.

Specifies the limit for the input stream buffering threshold, in KB. This limit can be used to prevent denial of service attacks that are caused, for example, by users posting large files to the server.

The default is 4096 (4 MB).

maxWaitChangeNotification

Optional Int32 attribute.

Specifies the maximum number of seconds to wait from the first file change notification before restarting the AppDomain for a new request. Set this attribute to a number that is greater than the length of time to complete any file copy processes. File change notifications are combined based on the value of this attribute and the waitChangeNotification attribute.

This attribute is new in the .NET Framework 2.0.

The default is 0.

minFreeThreads

Optional Int32 attribute.

Specifies the minimum number of free threads to allow execution of new requests. ASP.NET keeps the specified number of threads free for requests that require additional threads to complete processing.

The default is 8.

minLocalRequestFreeThreads

Optional Int32 attribute.

Specifies the minimum number of free threads that ASP.NET keeps available to allow execution of new local requests. The specified number of threads is reserved for requests that are coming from the local host, in case some requests issue child requests to the local host during processing. This helps to prevent a possible deadlock with recursive reentry into the Web server.

The default is 4.

requestLengthDiskThreshold

Optional Int32 attribute.

Specifies the limit for the input stream buffering threshold, in bytes. This value should not exceed the maxRequestLength attribute.

This attribute is new in the .NET Framework 2.0.

The default is 256.

requireRootedSaveAsPath

Optional Boolean attribute.

Specifies whether the filename parameter in a SaveAs method must be an absolute path. The ASP.NET process must have permission to create files in the specified location.

This attribute is new in the .NET Framework 2.0.

The default is True.

sendCacheControlHeader

Optional Boolean attribute.

Specifies whether to send a cache control header, which is set to Private, by default. If True, client-side caching is disabled.

This attribute is new in the .NET Framework 2.0.

The default is True.

shutdownTimeout

Optional TimeSpan attribute.

Specifies the number of minutes that are allowed for the worker process to shut down. When the time-out expires, ASP.NET shuts down the worker process.

This attribute is new in the .NET Framework 2.0.

The default is "00:01:30" (90 seconds).

useFullyQualifiedRedirectUrl

Optional Boolean attribute.

Specifies whether client-side redirects are fully qualified using the form "https://server/path", which is required for some mobile controls, or whether relative redirects are sent to the client instead. If True, all redirects that are not fully qualified are automatically converted to fully qualified form.

Note

If this attribute is set to False, some browsers might encounter issues when loading pages that are in cookieless sessions.

The default is False.

waitChangeNotification

Optional Int32 attribute.

Specifies the time, in seconds, to wait for another file change notification before restarting the AppDomain. Set this attribute to a number that is greater than the time between the updates of two file copy change notifications. File change notifications are combined based on the value of this attribute and the maxWaitChangeNotification attribute.

This attribute is new in the .NET Framework 2.0.

The default is 0 seconds.

Child Elements

None.

Parent Elements

Element Description

configuration

The required root element in every configuration file that is used by the common language runtime and the .NET Framework applications.

system.web

Specifies the root element for the ASP.NET configuration settings in a configuration file and contains configuration elements that configure ASP.NET Web applications and control how the applications behave.

Remarks

The httpRuntime element configures ASP.NET HTTP run-time settings that determine how a request for an ASP.NET application is processed. The .NET Framework provides a number of different run-time hosts, including the ASP.NET run-time host. When a request comes in, ASP.NET loads the run-time setting into the process that is to handle the request. ASP.NET also creates an application domain for each Web application that will run on a Web server.

Default Configuration

The httpRuntime element is not explicitly defined 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.

<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"
/>

Example

The following example demonstrates how to specify HTTP run-time parameters for an ASP.NET application.

<configuration>
  <system.web>
  <httpRuntime maxRequestLength="4000"
    enable = "True"
    requestLengthDiskThreshold="512
    useFullyQualifiedRedirectUrl="True"
    executionTimeout="45"
    versionHeader="1.1.4128"/>
  </system.web>
</configuration>

Element Information

Configuration section handler

HttpRuntimeSection

Configuration member

HttpRuntime

Configurable locations

Machine.config

Root-level Web.config

Application-level Web.config

Virtual or physical directory–level Web.config

Requirements

Microsoft Internet Information Services (IIS) 5.0, 5.1, or 6.0

The .NET Framework 1.0, 1.1, 2.0

Microsoft Visual Studio 2003 or Visual Studio 2005

See Also

Tasks

How to: Configure Specific Directories Using Location Settings
How to: Lock ASP.NET Configuration Settings

Reference

system.web Element (ASP.NET Settings Schema)
configuration Element (General Settings Schema)
System.Configuration
System.Web.Configuration
HttpRuntimeSection
HttpRuntime

Concepts

Caching ASP.NET Pages
ASP.NET Configuration File Hierarchy and Inheritance
Securing ASP.NET Configuration
ASP.NET Configuration Scenarios

Other Resources

General Configuration Settings (ASP.NET)
ASP.NET Configuration Settings
Configuring ASP.NET Applications
ASP.NET Configuration API