ERROR

InvalidArgument=Value of '-1' is not valid for 'index'. Parameter name: index

Last Published: April 25, 2020

Error Message

When attempting to use the ArcGIS Snippet Finder, a feature of the Visual Studio 2005 IDE Integration in the .NET Desktop or Engine SDK, the following error message may be returned:

"InvalidArgument=Value of '-1' is not valid for 'index'. Parameter name: index"

Cause

A choice that was once available in the drop-down for locations in searching snippets is no longer available.

The following are sample case scenarios of when this may occur:
(1) A directory in the ArcGIS Snippet Finder has been set to a custom location on the hard drive, and later the directory was deleted.
(2) A directory location has been deleted from the search preferences, but the drop-down was not changed prior to closing the ArcGIS Snippet Finder dialog box.
(3) Multiple .NET SDK's were installed and then one was uninstalled, but the drop-down was not changed prior to closing the ArcGIS Snippet Finder dialog box.

Solution or Workaround

All preferences for running the ArcGIS Snippet Finder dialog box are maintained by an XML file. The preference for a particular search location is no longer valid for the ArcGIS Snippet Finder and needs to be reset.

  1. Open Windows Explorer and type %TEMP% in the Address bar and press Enter. Find and delete the following file: ArcGISSnippetPreferences9.xml. The next time the ArcGIS Snippet Finder is launched, it will re-create the default preferences file.

Article ID:000009374

Software:
  • ArcMap 9 x
  • ArcGIS Engine 9 x

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Discover more on this topic