Archive for March, 2012

Okay, I’ve not done any blogging for a while, been mega busy… But I just came across this problem in a MOSS environment, which after a bit of digging was easily resolved. Just thought I’d share…

While trying to filter a list with a Telerik component. I came across the above error ( also shown in the screen shot below)


After looking in the log files I discovered that is was throwing an exception of type ThrowIfMaxHttpCollectionKeysExceeded

Entry in the log file 

Error=Operation is not valid due to the current state of the object.   at System.Web.HttpValueCollection.ThrowIfMaxHttpCollectionKeysExceeded()     at System.Web.HttpValueCollection.FillFromEncodedBytes(Byte[] bytes, Encoding encoding)     at System.Web.HttpRequest.FillInFormCollection()

After a bit of digging it turns out that this is a direct result of an MS update to thwart DOS attacks. As can be seen by the entry on Scott Guthrie’s Blog.  However, in this case, i was trying to fix an internal application so DOS attacks were not an issue.

To fix this issue add the following to the web.config file

  <add key="aspnet:MaxHttpCollectionKeys" value="Number greater than 1000 until the error goes away" />

I needed to set this value to 3000 to resolve the issue.   Surprised smile