Thursday, 16 July 2015

Operation is not valid due to the current state of the object' error during postback in SharePoint

Sometime SharePoint behave inversely. Yesterday I got below error when updating User Profile Service in SharePoint 2010.

Below is the stack trace:

at System.Web.HttpValueCollection.ThrowIfMaxHttpCollectionKeysExceeded()
at System.Web.HttpValueCollection.FillFromEncodedBytes(Byte[] bytes, Encoding encoding)
at System.Web.HttpRequest.FillInFormCollection()
Resolution:
Create below entry in Web.Config file of SharePoint Web Application
<appSettings>
<add key="aspnet:MaxHttpCollectionKeys" value="10000" />
</appSettings>