Thursday, April 12, 2012

Error: Operation is not valid due to the current state of the object

Snapshot:

In web.config file following entry should be made under appsettings tag.

<add key="aspnet:MaxHttpCollectionKeys" value="999999999"/>

As found on tech blog:


The newly released security update which addresses imposes a limit of 1000 form parameters.
Correct - once the patch is applied it by default limits the number of individual form fields to be 1000 per HTTP post. This is well below any type of DoS threashold, and we felt was large enough for all but a few applications.
This limit is configurable, though, and so if you do have scenarios where you need to post more than 1000 fields you can increase it. You can do this by adding a setting into the section of the web.config file for your application and setting the value appropriately.
For example:
appSettings
add key="aspnet:MaxHttpCollectionKeys" value="some number here"
appSettings
We've enabled this within so that you can set this in any application and not worry about it breaking on an un-patched server. 




Blog by BBSPL

No comments:

Post a Comment