You may receive an error in Business Portal Server Error in Application Operation is not valid due to the current state of the object
You may receive the following error in Business Portal if you are on .Net version 4.0 in varying places if you have met maximum limits.
Server Error in '/' Application
Operation is not valid due to the current state of the object
In December 2011, Microsoft released a security update for ASP.NET. In the update, Microsoft introduced a limit to the number of data elements on an ASP.NET form. The default limit is 1000 data elements. Exceeding the limit will cause a throwifMaxHttpCollectionKeysExceeded type error message.
After applying the patch, forms that exceed the limit will generate an error similar to what I have above.
To fix the issue in Business Portal, we need to make a change to the web.config file in the appSettings section.
Here are the steps:
1. Go to your web.config file on the Business Portal server.
Example location of mine
Make a copy of the file prior to editing.
2. Open the file in in notepad
Go to the bottom where you find this
Add this below line in the web.config like I did to mine….I used 2000, use what you want so you will not exceed the limit in your environment.
<add key="aspnet:MaxHttpCollectionKeys" value="2000" />
Save and close the web.config file.
3. Click Start | Run type iisreset
Log back into Business Portal and you should not see the error message.
Example of mine: