0

I have a page for a site in production that lists every Store in a Shopping Center. This allows the District Managers to detect changes to the tenancy of the Center.

One of the Shopping Centers has 107 stores in it, and the DM was receiving a weird error that is not the MVC Error Page every time he tries to save his process at this one Center (the dreaded "Server Error in '/' Application.").

I am walking through the code in the Debugger, and on the form submission for the page, the Controller's Constructor gets called, and as soon as it finishes out the Constructor, it goes immediately to the Dispose method. Any other version of the page (with a different Shopping Center) I've gone to goes from the Constructor to the requested Controller Method.

I've gone in the Web.config and changed the maxRequestLength to 8192, the maxQueryStringLength to 4096, and even the maxUrlLength to 1040 in the thought that perhaps the data being sent back on form submission was too large, but everything is still giving the same error.

I can provide some code if needed, but like I said it's not getting to the requested method, it goes directly from the Constructor to the Dispose method. I've checked the Call stack when it enters Dispose, but everything is listed as [External Code].

krillgar
  • 12,596
  • 6
  • 50
  • 86
  • 1
    We can't help you as stated; I'd try a few things to narrow it down: Check the event log for Windows and see if it records an error; once you get that, check the source code it refers to, and if you have a problem, post that code. – George Stocker Jul 08 '13 at 18:26
  • Thanks. I really had no idea where to start to look. I'll get on that. The Constructor goes through fine without any problems. I added a try/catch that does not find an error. – krillgar Jul 08 '13 at 18:30
  • @GeorgeStocker I found my problem. I would think this would be a good idea to leave as a question, and I can answer it myself. I was doing Google Searches for things along the lines of my title, and got absolutely no where. That could be invaluable for someone else with the same problem. If you think that it still does not meet the standards, let me know if we can rework this to help others out. – krillgar Jul 08 '13 at 18:45

1 Answers1

0

Per George Stocker's suggestion, I found the following in the Event Viewer:

Exception information:

Exception type: InvalidOperationException Exception message: 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()

When I took a look at System.Web.HttpValueCollection.ThrowIfMaxHttpCollectionKeysExceeded(), I found this thread which explains how to rectify that. Making their suggested change, I was able to submit the form with no problem.

Community
  • 1
  • 1
krillgar
  • 12,596
  • 6
  • 50
  • 86