Sugerir traducción
 
Otros han sugerido:

progress indicator
No hay más sugerencias.
Evaluar y enviar comentarios
Contraer todo/Expandir todo Contraer todo
Ver contenido:  en paraleloVer contenido: en paralelo
.NET Framework 4
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
   apartmentThreading = "[True|False]"
   appRequestQueueLimit = "number"
   delayNotificationTimeout = "number"
   enable = "[True|False]" 
   enableHeaderChecking = "[True|False]" 
   enableKernelOutputCache = "[True|False]" 
   enableVersionHeader = "[True|False]" 
   encoderType = "name"
   executionTimeout = "number"   
   maxRequestLength = "number" 
   maxWaitChangeNotification = "number" 
   minFreeThreads = "number" 
   minLocalRequestFreeThreads = "number" 
   requestLengthDiskThreshold = "number" 
   requestValidationMode = "[2.0|4.0]"
   requestValidationType = "name"
   requireRootedSaveAsPath = "[True|False]"
   sendCacheControlHeader = "[True|False]" 
   shutdownTimeout = "number"
   useFullyQualifiedRedirectUrl = "[True|False]" 
   waitChangeNotification = "number" 
/>

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

Attributes

Attribute

Description

apartmentThreading

Optional Boolean attribute.

Enables apartment threading for classic ASP compatibility.

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. For the .NET Framework versions 1.0 and 1.1, the default is 100.

delayNotificationTimeout

Optional Int32 attribute.

Specifies the time-out in seconds for delaying notifications.

The default is 5.

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.

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.

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

The default is True.

encoderType

Gets or sets the name of a custom type that can be used to handle HTML and URL encoding.

ASP.NET uses the HttpEncoder type as the default handler for HTML and URL encoding tasks. To customize encoding behavior, you can create a class that inherits from the HttpEncoder type. In the configuration file for an application, you then set the EncoderType attribute of the httpRuntime element to the fully qualified string name of the custom type.

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

executionTimeout

Optional Int32 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. If the debug attribute is True, to help avoiding application shut-down while you are debugging, do not set this time-out to a large value.

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

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. If the threshold is exceeded, a ConfigurationErrorsException exception is thrown.

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.

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 kilobytes. This value should not exceed the maxRequestLength attribute.

The default is 80.

requestValidationMode

Optional Int32 attribute.

Gets or sets a version number that indicates which ASP.NET version-specific approach to validation will be used.

The value that you assign to this property is not validated to match a specific version of ASP.NET. Any numeric value smaller than 4.0 (for example, 3.7, 2.9, or 2.0) is interpreted as 2.0. Any number larger than 4.0 is interpreted as 4.0

The default is 4.0.

requestValidationType

Optional String attribute.

Gets or sets the name of a type that is used to validate HTTP requests.

To customize ASP.NET request validation behavior, you can create a class that inherits from the RequestValidator type. In the configuration file for an application, you then set the requestValidationType attribute of the httpRuntime element to the fully qualified string name of the custom type.

The default is the fully qualified name of the RequestValidator type that ASP.NET uses for validation

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.

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.

The default is True.

shutdownTimeout

Optional Int32 attribute.

Specifies the number of seconds that are allowed for the worker process to shut down. When the timeout expires, ASP.NET shuts down the worker process.

The default is 90 seconds.

useFullyQualifiedRedirectUrl

Optional Boolean attribute.

Specifies whether client-side redirects are fully qualified using the form "http://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.

NoteNote
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.

The default is 0.

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.

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

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>

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

.NET Framework 4
Elemento httpRuntime (Esquema de configuración de ASP.NET)

Establece los valores de configuración HTTP de ASP.NET en tiempo de ejecución que determinan cómo se procesa una solicitud de una aplicación ASP.NET.

<httpRuntime
   apartmentThreading = "[True|False]"
   appRequestQueueLimit = "number"
   delayNotificationTimeout = "number"
   enable = "[True|False]" 
   enableHeaderChecking = "[True|False]" 
   enableKernelOutputCache = "[True|False]" 
   enableVersionHeader = "[True|False]" 
   encoderType = "name"
   executionTimeout = "number"   
   maxRequestLength = "number" 
   maxWaitChangeNotification = "number" 
   minFreeThreads = "number" 
   minLocalRequestFreeThreads = "number" 
   requestLengthDiskThreshold = "number" 
   requestValidationMode = "[2.0|4.0]"
   requestValidationType = "name"
   requireRootedSaveAsPath = "[True|False]"
   sendCacheControlHeader = "[True|False]" 
   shutdownTimeout = "number"
   useFullyQualifiedRedirectUrl = "[True|False]" 
   waitChangeNotification = "number" 
/>

En las secciones siguientes se describen los atributos, los elementos secundarios y los elementos primarios.

Atributos

Atributo

Descripción

apartmentThreading

Atributo Boolean opcional.

Habilita los subprocesos de apartamento para la compatibilidad con ASP clásica.

El tipo predeterminado es False.

appRequestQueueLimit

Atributo Int32 opcional.

Especifica el número máximo de solicitudes que ASP.NET coloca en la cola de la aplicación. Cuando no hay suficientes subprocesos libres para procesar las solicitudes, éstas se dejan en una cola. Las solicitudes entrantes se rechazarán con el mensaje de error "503 - Server Too Busy" (servidor ocupado) cuando la cola supere el límite especificado en este atributo.

El valor predeterminado es 5000. En las versiones 1.0 y 1.1 de .NET Framework, el valor predeterminado es 100.

delayNotificationTimeout

Atributo Int32 opcional.

Especifica el tiempo de espera en segundos para retrasar las notificaciones.

El valor predeterminado es 5.

enable

Atributo Boolean opcional.

Especifica si el dominio de aplicación (AppDomain) está habilitado para aceptar las solicitudes entrantes en el nodo actual y en los nodos secundarios. Si su valor es False, la aplicación está desactivada.

El valor predeterminado es True.

enableHeaderChecking

Atributo Boolean opcional.

Especifica si ASP.NET debe comprobar si el encabezado de la solicitud sufre posibles ataques de inyección. Si se detecta un ataque, ASP.NET responde con un error.

El valor predeterminado es True.

enableKernelOutputCache

Atributo Boolean opcional.

Especifica si está habilitado el almacenamiento en la caché de resultados. Este atributo es relevante sólo si está instalado Microsoft Internet Information Services (IIS) 6.0 o posterior. La configuración del almacenamiento en la caché de resultados y el tipo de solicitud determinan si el contenido puede almacenarse en caché.

Para almacenar una respuesta en la memoria caché, deben cumplirse los siguientes criterios:

  • El almacenamiento en caché debe habilitarse explícitamente mediante una directiva de página o la API de almacenamiento en caché.

  • El almacenamiento en caché debe tener una directiva de expiración de modo que la memoria del kernel sepa cuándo debe descartar la respuesta.

  • El almacenamiento en caché no tiene encabezados ni parámetros variables.

  • La autenticación no es necesaria.

El valor predeterminado es True.

enableVersionHeader

Atributo Boolean opcional.

Especifica si ASP.NET debe generar un encabezado de versión. Microsoft Visual Studio 2005 usa este atributo para determinar qué versión de ASP.NET se está utilizando. No es necesario para los sitios de producción y se puede deshabilitar.

NotaNota
Este atributo no está disponible en .NET Framework 1.0.

El valor predeterminado es True.

encoderType

Obtiene o establece el nombre de un tipo personalizado que se puede utilizar para administrar la codificación de HTML y de direcciones URL.

ASP.NET usa el tipo HttpEncoder como el controlador predeterminado para HTML y tareas de codificación de dirección URL. Para personalizar el comportamiento de codificación, puede crear una clase que hereda del tipo HttpEncoder. En el archivo de configuración para una aplicación, se establece el atributo EncoderType del elemento httpRuntime en el nombre de cadena completo del tipo personalizado.

Este atributo es nuevo en la versión 4 de .NET Framework.

executionTimeout

Atributo Int32 opcional.

Especifica, en segundos, el tiempo máximo durante el cual una solicitud puede ejecutarse antes de que ASP.NET la cierre automáticamente.

Este tiempo de espera sólo se aplica si el atributo de depuración del elemento compilation tiene el valor False. Si el atributo debug es True, para ayudar a evitar que se cierre la aplicación mientras realiza la depuración, no establezca este tiempo de espera en un valor alto.

El valor predeterminado es 110. En .NET Framework 1.0 y 1.1, el valor predeterminado es 90 segundos.

maxRequestLength

Atributo Int32 opcional.

Especifica, en KB, el límite del umbral del almacenamiento en búfer de los flujos de entrada. Este límite puede usarse para los ataques de denegación de servicio que se producen, por ejemplo, cuando los usuarios envían archivos de gran tamaño al servidor.

El valor predeterminado es 4096. Si se supera el umbral, se produce una excepción ConfigurationErrorsException.

maxWaitChangeNotification

Atributo Int32 opcional.

Especifica el número máximo de segundos que se debe esperar desde la primera notificación de cambios del archivo antes de reiniciar AppDomain para una nueva solicitud. Establezca el valor de este atributo en un número mayor que el tiempo que tardan los procesos de copia de archivo en finalizar. Las notificaciones de cambios del archivo se combinan basándose en el valor de este atributo y del atributo waitChangeNotification.

El valor predeterminado es 0.

minFreeThreads

Atributo Int32 opcional.

Especifica el número mínimo de subprocesos libres para permitir la ejecución de nuevas solicitudes. ASP.NET mantiene libre el número especificado de subprocesos para atender las solicitudes que requieran subprocesos adicionales para completar su procesamiento.

El valor predeterminado es 8.

minLocalRequestFreeThreads

Atributo Int32 opcional.

Especifica el número mínimo de subprocesos libres que ASP.NET mantiene disponibles para permitir la ejecución de nuevas solicitudes locales. El número especificado de subprocesos se mantiene reservado para las solicitudes procedentes del host local, en previsión de que algunas generen solicitudes secundarias al host local durante su procesamiento. Esto ayuda a evitar un posible interbloqueo con una nueva entrada recursiva en el servidor Web.

El valor predeterminado es 4.

requestLengthDiskThreshold

Atributo Int32 opcional.

Especifica, en kilobytes, el límite del umbral del almacenamiento en búfer de los flujos de entrada. Este valor no debe superar el valor del atributo maxRequestLength.

El valor predeterminado es 80.

requestValidationMode

Atributo Int32 opcional.

Obtiene o establece un número de versión que indica qué enfoque de validación específico de la versión de ASP.NET se va a usar.

El valor que tiene asignado a esta propiedad no se valida para que coincida con una versión concreta de ASP.NET. Cualquier valor numérico menor que 4.0 (por ejemplo, 3.7, 2.9 o 2.0) se interpreta como 2.0. Cualquier número mayor que 4.0 se interpreta como 4.0.

El tipo predeterminado es 4.0.

requestValidationType

Atributo String opcional.

Obtiene o establece el nombre de un tipo que se utiliza para validar las solicitudes HTTP.

Para personalizar el comportamiento de validación de solicitudes de ASP.NET, puede crear una clase que hereda del tipo RequestValidator. En el archivo de configuración para una aplicación, se establece el atributo requestValidationType del elemento httpRuntime en el nombre de cadena completo del tipo personalizado.

El valor predeterminado es el nombre completo del tipo de RequestValidator que ASP.NET utiliza para la validación.

requireRootedSaveAsPath

Atributo Boolean opcional.

Especifica si el parámetro filename de un método SaveAs debe ser una ruta de acceso absoluta. El proceso de ASP.NET debe tener permiso para crear archivos en la ubicación especificada.

El valor predeterminado es True.

sendCacheControlHeader

Atributo Boolean opcional.

Especifica si se envía un encabezado de control de caché; su valor se establece en Private de manera predeterminada. Si su valor es True, estará deshabilitado el almacenamiento en caché en el cliente.

El valor predeterminado es True.

shutdownTimeout

Atributo Int32 opcional.

Especifica el número de segundos que se conceden al proceso de trabajo para que se cierre por sí mismo. Una vez expirado este plazo, ASP.NET cierra el proceso de trabajo.

El valor predeterminado es 90 segundos.

useFullyQualifiedRedirectUrl

Atributo Boolean opcional.

Especifica si los redireccionamientos de cliente son completos, con el formato "http://server/path", lo cual es necesario para algunos controles móviles, o si en su lugar se envían al cliente redireccionamientos relativos. Si su valor es True, todas las redirecciones no completas se convierten automáticamente en completas.

NotaNota
Si el atributo se establece en False, puede que algunos exploradores tengan problemas al cargar páginas en sesiones sin cookies.

El tipo predeterminado es False.

waitChangeNotification

Atributo Int32 opcional.

Especifica el tiempo, en segundos, que se debe esperar hasta otra notificación de cambios del archivo antes de reiniciar AppDomain. Establezca este atributo en un número mayor que el tiempo que transcurre entre las actualizaciones de dos notificaciones de cambios de la copia de archivo. Las notificaciones de cambios del archivo se combinan basándose en el valor de este atributo y del atributo maxWaitChangeNotification .

El valor predeterminado es 0.

Elementos secundarios

Ninguno.

Elementos primarios

Elemento

Descripción

configuration

Elemento raíz requerido de cada archivo de configuración utilizado por Common Language Runtime y las aplicaciones de .NET Framework.

system.web

Especifica el elemento raíz de los valores de configuración ASP.NET en un archivo de configuración y contiene elementos de configuración que configuran las aplicaciones Web ASP.NET y controlan el comportamiento de las aplicaciones.

El elemento httpRuntime establece los valores de configuración HTTP de ASP.NET en tiempo de ejecución que determinan cómo se procesa una solicitud de una aplicación ASP.NET. .NET Framework proporciona varios hosts en tiempo de ejecución, incluido el host en tiempo de ejecución de ASP.NET. Cuando entra una solicitud, ASP.NET carga el valor en tiempo de ejecución en el proceso que debe controlar la solicitud. ASP.NET crea también un dominio de aplicación para cada aplicación Web que se vaya a ejecutar en un servidor Web.

Configuración predeterminada

El elemento httpRuntime no se define explícitamente en el archivo Machine.config ni en el archivo Web.config raíz. Sin embargo, los siguientes son los valores predeterminados que inicializa el sistema. Si necesita personalizar esta sección, debe crearla en su archivo de configuración y debe definir sólo los atributos que necesitan personalización.

<httpRuntime 
   executionTimeout="110"
   maxRequestLength="4096"
   requestLengthDiskThreshold="80"
   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"
/>

En el ejemplo siguiente se muestra cómo especificar los parámetros HTTP del motor en tiempo de ejecución para una aplicación ASP.NET.

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

Controlador de la sección de configuración

HttpRuntimeSection

Miembro de configuración

HttpRuntime

Ubicaciones configurables

Machine.config

Web.config del nivel raíz

Web.config del nivel de aplicaciones

Web.config del nivel de directorio virtual o físico

Requisitos

Microsoft Internet Information Services (IIS) versión 5.0, 5.1 o 6.0

.NET Framework 1.0, 1.1 ó 2.0

Microsoft Visual Studio 2003 o Visual Studio 2005

Contenido de la comunidad   ¿Qué es Community Content?
Agregar contenido nuevo RSS  Anotaciones
Processing
© 2012 Microsoft. Reservados todos los derechos. Términos de uso | Marcas Registradas | Privacidad
Page view tracker