How to fix Server Error in '/GpsGateServer' Application


You get an error similar to the following when browsing the Device Type page in Site Admin or when saving an Application in Site Admin.

"Server Error in '/GpsGateServer' Application.

Operation is not valid due to the current state of the object.

Stack Trace:


This error occurs because of the number of form fields that your device type contains. A limit of 1000 form fields was added in an ASP.NET security fix recently released by Microsoft. 
See here for more info about the security fix.



You can raise the limit by adding an application setting in the GpsGateServer/IIS/Web.config file.

<add key="aspnet:MaxHttpCollectionKeys" value="5000"/>