I have some code running as a Web Application on an IIS 7/Server 2008 box written in VB that has been fine for years, suddenly it's blowing up with an exception I've never heard of before:
I did a google search on ThrowIfMaxHttpCollectionKeysExceeded and it returned a single hit, a post on social.technet.microsoft.com's Korean site, posted less than 24 hours ago. Address of that post:
I'm using ASP.NET 2.0
Windows patch
Windows Server 2003 and Windows XP x86 Microsoft. NET Framework 2.0 SP2 Security Update for (KB2656352)
Windows XP, Windows Server 2003, Windows Vista and Windows Server 2008 x86 on the Microsoft. NET Framework 3.5 SP1 Security Update for (KB2657424)
Windows Server 2003 and Windows Server 2003 R2 x86 Microsoft. NET Framework 1.1 SP1 Security Update for (KB2656358)
I headed to patch an existing site after issuing an error bout Is it any problem?
Server Error in '/' Application has
--------------------------------------- -----------------------------------------
Because of the current state of the object, the operation is not valid
description: during the execution of the current web request an unhandled exception has occurred. Review the stack trace the error and where it originated in the code can find more information about the location.
Exception Details: System.InvalidOperationException: Because of the current state of the object, the operation is not valid.
Source Error:
During the execution of the current web request an unhandled exception was generated. Using the exception stack trace below information regarding the origin and location of the exception can be found.
Stack Trace:
[InvalidOperationException: object's current state is not valid because the job.]
System.Web.HttpValueCollection.ThrowIfMaxHttpCollectionKeysExceeded () +2692302
System.Web.HttpValueCollection.FillFromEncodedBytes (Byte [] bytes, Encoding encoding) +61
System.Web.HttpRequest. FillInFormCollection () +148
[HttpException (0x80004005): URL-encoded form data is invalid.]
System.Web.HttpRequest.FillInFormCollection () +206
System.Web.HttpRequest.get_Form () +68
System.Web.HttpRequest.get_HasForm () +8735447
System.Web.UI.Page.GetCollectionBasedOnMethod (Boolean dontReturnNull) +97
System.Web.UI.Page.DeterminePostBackMode () +63
System.Web.UI.Page.ProcessRequestMain (Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +133
-------------------------------------------------- ------------------------------
Version Information: Microsoft. NET Framework version: 2.0.50727.3625; ASP.NET Version: 2.0. 50727.3634
These errors do not smell.
=========================
I applied updates to my server last night. To me, these errors DO smell.
Anybody else seeing anything fishy with their .Net 2.0 Asp.Net code as of the new updates?
I have added the setting, but still am getting the error. I set mine to 10000, but still does not seem to help. I have an application that is completely dynamic for the number of items that show, basically it is a workflow and all items that need to process
show on the page. The user will check off those that should move to the next phase. I use a number of hidden fields to keep the data I need when it submits without having to call the database again. This is a horrible feature. I am now possibly going to have
to rewrite the application, but it just went live for my customer. What is the deal MSFT????
I have a listview and it may have several hundred items, actually there is a nested listview in a listview to have a parent child details. Each of the line item details may be checked off to note it has been processed. So it is completely dynamic. In my
error logging, seems the actual number of bytes is not being logged, so I will enhance that. If I have 200 orders and estimated at 5 items per order, then that would be what posts, however I do have a number of hidden fields per. So lets say 10, so I come
up with 10000 for the number, which others are saying 2001 helps them.
This app is actually ASP.Net 4.0 not 2.0, so if that matters.
I have a dev machine I can point to the production SQL and found the page giving me fits has 1234 form elements posted back. I found my development server did not have the patch, so I will apply it and see if I can rework the pages to not use the hidden
form elements and just query SQL for the data I need each time (seems more chatty, than look up once and pass it around).
TomPinColo
0 Points
1 Post
New .Net 2.0 Bug From Windows Update?
Dec 30, 2011 10:44 PM|LINK
I have some code running as a Web Application on an IIS 7/Server 2008 box written in VB that has been fine for years, suddenly it's blowing up with an exception I've never heard of before:
System.Web.HttpValueCollection.ThrowIfMaxHttpCollectionKeysExceeded()
I did a google search on ThrowIfMaxHttpCollectionKeysExceeded and it returned a single hit, a post on social.technet.microsoft.com's Korean site, posted less than 24 hours ago. Address of that post:
http://social.technet.microsoft.com/Forums/ko-KR/windowsserverko/thread/047b18f2-5e43-4267-b39c-f4b25bd9aed4
Contents (translated from Korean):
=========================
=========================
I applied updates to my server last night. To me, these errors DO smell.
Anybody else seeing anything fishy with their .Net 2.0 Asp.Net code as of the new updates?
mbanavige
All-Star
134949 Points
15415 Posts
ASPInsiders
Moderator
MVP
Re: New .Net 2.0 Bug From Windows Update?
Dec 31, 2011 12:06 AM|LINK
Please read this as it likely relates to your error:
http://weblogs.asp.net/scottgu/archive/2011/12/28/asp-net-security-update-shipping-thursday-dec-29th.aspx
How many form fields did you expect to be posted from your page that threw the error?
mbanavige
All-Star
134949 Points
15415 Posts
ASPInsiders
Moderator
MVP
Re: New .Net 2.0 Bug From Windows Update?
Dec 31, 2011 12:15 AM|LINK
note that the default number of fields posted may be limited to 1000 if you have installed the latest patch.
refer: http://stackoverflow.com/questions/8684049/asp-net-ms11-100-and-post
btsrajkumar
Member
4 Points
2 Posts
Re: New .Net 2.0 Bug From Windows Update?
Jan 11, 2012 06:15 PM|LINK
Hi TomPinColo,
I face similar issues in one of my applications. Did you find any solution for this issue yet? Thanks.
-Raj
mbanavige
All-Star
134949 Points
15415 Posts
ASPInsiders
Moderator
MVP
Re: New .Net 2.0 Bug From Windows Update?
Jan 11, 2012 06:29 PM|LINK
If the stack trace contains this:
System.Web.HttpValueCollection.ThrowIfMaxHttpCollectionKeysExceeded
Then somebody posted quite a few form fields to your page. The new default max introduced by the recent security update is 1000.
If you were expecting more than 1000 values to be posted, then you can alter that max to allow more. Please read through that link i had previously posted: http://stackoverflow.com/questions/8684049/asp-net-ms11-100-how-can-i-change-the-limit-on-the-maximum-number-of-posted-for
btsrajkumar
Member
4 Points
2 Posts
Re: New .Net 2.0 Bug From Windows Update?
Jan 11, 2012 07:23 PM|LINK
Thanks mbanavige, adding the below element in the web.config fixed the issue.
andy_univers...
Member
12 Points
6 Posts
Re: New .Net 2.0 Bug From Windows Update?
Jan 12, 2012 08:15 PM|LINK
I have added the setting, but still am getting the error. I set mine to 10000, but still does not seem to help. I have an application that is completely dynamic for the number of items that show, basically it is a workflow and all items that need to process show on the page. The user will check off those that should move to the next phase. I use a number of hidden fields to keep the data I need when it submits without having to call the database again. This is a horrible feature. I am now possibly going to have to rewrite the application, but it just went live for my customer. What is the deal MSFT????
mbanavige
All-Star
134949 Points
15415 Posts
ASPInsiders
Moderator
MVP
Re: New .Net 2.0 Bug From Windows Update?
Jan 12, 2012 08:45 PM|LINK
How may form inputs are you posting when you receive the error?
andy_univers...
Member
12 Points
6 Posts
Re: New .Net 2.0 Bug From Windows Update?
Jan 12, 2012 08:54 PM|LINK
I have a listview and it may have several hundred items, actually there is a nested listview in a listview to have a parent child details. Each of the line item details may be checked off to note it has been processed. So it is completely dynamic. In my error logging, seems the actual number of bytes is not being logged, so I will enhance that. If I have 200 orders and estimated at 5 items per order, then that would be what posts, however I do have a number of hidden fields per. So lets say 10, so I come up with 10000 for the number, which others are saying 2001 helps them.
This app is actually ASP.Net 4.0 not 2.0, so if that matters.
andy_univers...
Member
12 Points
6 Posts
Re: New .Net 2.0 Bug From Windows Update?
Jan 13, 2012 12:22 AM|LINK
I have a dev machine I can point to the production SQL and found the page giving me fits has 1234 form elements posted back. I found my development server did not have the patch, so I will apply it and see if I can rework the pages to not use the hidden form elements and just query SQL for the data I need each time (seems more chatty, than look up once and pass it around).