Archives for category: IIS

Recently, after a patch was applied to the web server, some of our larger, more intensive applications starting throwing the following fairly cryptic exception:

ERROR: System.Web.HttpException: The URL-encoded form data is not valid.
System.InvalidOperationException:  Operation is not valid due to the current state of the object.

This is due to an update (MS11-100) that was pushed out in December 2011 that allows a web form to accept a limit of 1,000 items.

The fix is easy, simply add an item to your web.config appSettings section.  The following example increases the number of items accepted by a web form from 1,000 to 9,999:

<appSettings>
  <add key=”aspnet:MaxHttpCollectionKeys” value=”9999″ />
</appSettings>

Advertisements

We had a reported application issue in which the user was receiving a “Request entity is too large” over SSL only.  When accessing the same application with the same data over regular HTTP, everything worked fine.

Upon further research, we determined that over SSL, the entire request entity body must be preloaded during negotiation.  In addition, SSL will use the value of the UploadReadAheadSize metabase property to validate the request size.  http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/7e0d74d3-ca01-4d36-8ac7-6b2ca03fd383.mspx?mfr=true

The UploadReadAheadSize metabase property specifies the number of bytes that a Web server will read into a buffer and pass to an ISAPI extension or module. This occurs once per client request. The ISAPI extension or module receives any additional data directly from the client.

To fix this issue, the UploadReadAheadSize metabase property value needs to be increased.  Plesae note that the default value for the UploadReadAheadSize is 49152.  The maximum size for this property is 2147483647.

In this example, we will increase the value to “204800”.

  1. On the web server, open the command prompt Run –> CMD.EXE.
  2. Change directories to the C:\Windows\SysWOW64\inetsrv (assumes 64-bit) –> CD C:\Windows\SysWOW64\inetsrv
  3. Determine the current metabase property value: appcmd.exe list config –section:system.webServer/serverRuntime
  4. Increase the metabase property value:  appcmd.exe set config -section:system.webServer/serverRuntime /uploadReadAheadSize:”204800″
    /commit:apphost

image