Aug 22, 2013

appSettings Configuration Keys ASP.Net


Many of us are aware of appSettings section in configruation file. But ASP.Net has provided few configuration keys which can be used to override default settings by developers while developing applications. These settings can be mentioned in Machine.config. 


Below are few appSettings Configuration Keys:

aspnet:AllowAsyncDuringSyncStages
Description:
Specifies whether ASP.NET will perform extra checks during runtime to catch common mistakes that developers make while performing asynchronous coding.
Remarks:
If this key value is false [default] and the UseTaskFriendlySynchronizationContext key value is true, ASP.NET will perform extra checks during runtime. These checks catch common mistakes that are made in asynchronous coding. Otherwise, no such checks are performed. The checks detect mistakes such as trying to start an asynchronous operation during execution of a synchronous page or causing an IHttpModule or IHttpAsyncHandler to complete when there are still outstanding asynchronous operations. Such mistakes could lead to deadlocks or could hamper performance of an ASP.NET application.
Example:
<appSettings>
      <add key="aspnet:AllowAsyncDuringSyncStages" value="false" />
    </appSettings>
     
   
aspnet:AllowRelaxedHttpUserName
Description:
Specifies how ASP.NET synchronizes the client’s username between the managed (ASP.NET) and native (IIS) layers of the web server.
Remarks:
If this key value is false [default], ASP.NET checks the client’s username before it performs this synchronization step. If this key value is true, ASP.NET performs no check.
Example:
    <appSettings>
      <add key="aspnet:AllowRelaxedHttpUserName" value="false" />    </appSettings>

aspnet:AllowRelaxedRelativeUrl
Description:
Specifies how ASP.NET login pages will redirect to a return URL whose destination is outside the hosted application.
Remarks:
If this key value is false [default], ASP.NET login pages will not redirect to a return URL whose destination is outside the hosted application. If this key value is true, ASP.NET login pages will perform no such check on the return URL and will redirect to it regardless.
Example:
    <appSettings>
      <add key="aspnet:AllowRelaxedRelativeUrl" value="false" />
    </appSettings>

aspnet:AllowRelaxedUnicodeDecoding
Description:
Specifies whether ASP.NET will perform additional Unicode validation on incoming client-supplied data.
Remarks:
If this key value is false [default], ASP.NET will perform additional Unicode validation on incoming client-supplied data. If this key value is true, ASP.NET will not perform extra validation.
Example:
    <appSettings>
      <add key="aspnet:AllowRelaxedUnicodeDecoding" value="false" />
    </appSettings>

aspnet:JavaScriptDoNotEncodeAmpersand
Description:
Specifies whether the default built-in JavaScript string encoding routines will encode the ampersand ('&') character.
Remarks:
If this key value is false [default], the default built-in JavaScript string encoding routines will encode the ampersand ('&') character as "\u0026", which is the JavaScript-escaped form of that character. If key value is true, the default built-in JavaScript string encoding routines will not encode the ampersand character.
Example:
    <appSettings>
      <add key="aspnet:JavaScriptDoNotEncodeAmpersand" value="false" />
    </appSettings>

aspnet:MaxConcurrentCompilations
Description:
Controls parallel compilation of non-dependencies in web directories.
Remarks:
If this key value is "0", all server cores will be used for concurrent compilations. If the key value is "1" [default], concurrent compilations will be disabled. If the key value is "2" or more, concurrent core compilation will be explicitly set to this value and will act as the max value.
Example:
    <appSettings>
      <add key="aspnet:MaxConcurrentCompilations" value="1" />
    </appSettings>

aspnet:MaxHttpCollectionKeys
Description:
Limits the maximum number of items that can be present in any of the client-provided dictionaries of the HttpRequest object.
Remarks:
The client-provided dictionaries include HttpRequest.Files, HttpRequest.Form, HttpRequest.Cookies, HttpRequest.QueryString, HttpRequest.Headers, HttpRequest.ServerVariables.
Example:
    <appSettings>
      <add key="aspnet:MaxHttpCollectionKeys" value="1000" />
    </appSettings>

aspnet:RestrictXmlControls
Description:
Specifies how ASP.NET will load XSLTs.
Remarks:
If this key value is false [default], ASP.NET’s XML controls use XslTransform for XSLT operations. If this key value is true, ASP.NET’s XML controls use XslCompiledTransform for XSLT operations.
Example:
    <appSettings>
      <add key="aspnet:RestrictXmlControls" value="false" />
    </appSettings>

PageInspector:ServerCodeMappingSupport
Description:
Specifies whether the Page Inspector is enabled in Visual Studio.
Remarks:
If the PageInspector:ServerCodeMappingSupport key value is set to Enabled in the Web application, the Page Inspector will be enabled, except if a retail attribute of the deployment element is set to true in the section of the Machine.config file. If the retail attribute is not set in the Machine.config file and the PageInspector:ServerCodeMappingSupport key value is also not set, debug mode will determine whether the Page Inspector is enabled.
Example:
    <appSettings>
      <add key="PageInspector:ServerCodeMappingSupport" value="Disabled" />
    </appSettings>

aspnet:UpdatePanelMaxScriptLength
Description:
Specifies a JSON payload size limit value that the ScriptManager will use to temporarily override the limit that the JavaScriptSerializer will allow when sending large JSON payloads to the client.
Remarks:
The JavaScriptSerializer type has a limit on the maximum JSON payload size it can produce or consume. This limit defaults to 2MB and is configurable via the MaxJsonLength property. The ScriptManager type uses JavaScriptSerializer internally. If this key value is set to a value greater than 0, ScriptManager will temporarily override the limit that the JavaScriptSerializer will allow when sending large JSON payloads to the client, using the provided key value as the JSON payload size limit. If this switch is set to 0, ScriptManager will not override the JavaScriptSerializer default limits.
Example:
    <appSettings>
      <add key="aspnet:UpdatePanelMaxScriptLength" value="0" />
    </appSettings>

1 comment:

  1. This comment has been removed by a blog administrator.

    ReplyDelete