Product Affected: MapXtreme® .NET
Version: All supported versions
Operating System: Windows 7, 8, 10, 2008 with SP2, 2008 R2, 2012, 2012 R2
Version: All supported versions
Operating System: Windows 7, 8, 10, 2008 with SP2, 2008 R2, 2012, 2012 R2
Issue
When starting a MapXtreme .NET web application, the server returns this error:
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Cause
The "index out of range" error occurs because the MapFactory is empty and there is no map to be used. The most common reason for this is a problem loading the workspace.
Resolution
UPDATED: September 13, 2017Here are steps to resolve the issue:
If the issue is still not resolved, contact client support.
- Ensure that the web.config contains the correct path to the workspace file.
- Open the workspace in WorkspaceManager on the server itself to make sure all the tables are available.
- Verify that the Map alias in the workspace file (.MWS) is the same as the Map alias specified in the MapControl.
- Make sure that the web application has the proper permission to access the workspace and all the associated tables and data.
If the issue is still not resolved, contact client support.