Problem: ArcGIS Snippets have problems in Visual Studio 2005
There are several scenarios in which ArcGIS Snippets have problems in the Visual Studio 2005 (VS2005) from the .NET SDKs. The solution for all of the undesired behavior is the same. The following list illustrates the different behaviors:
1. When opening VS2005 a message appears "Indexing Code Snippet folders..." that takes a long time to process and VS2005 seems to run slowly.
2. When inserting an ArcGIS Snippet by right-clicking in the VS2005 code editor and selecting 'Insert Snippet', the option for ArcGIS Engine and/or ArcGIS Desktop repeats itself several times.
3. When inserting an ArcGIS Snippet by right-clicking in the VS2005 code editor and selecting 'Insert Snippet', the option for ArcGIS Engine and/or ArcGIS Desktop appears. When selecting a snippet to insert, nothing is inserted.
Either the .NET SDK (Desktop or Engine) has been installed multiple times or the ArcGIS snippets have been deleted from the hard drive.
ArcGIS Snippets are just XML files that get read and portions are inserted into the VS2005 code editor. The VS2005 IDE keeps track of all snippets that are installed on the system in an index file. This index file is maintained wholly by VS2005. Performing an uninstall/reinstall of any 9.2 .NET SDK, moving or renaming of any ArcGIS Snippets causes the index file to get out of sync and causes the problems described above.
Solution or Workaround
- Close Visual Studio 2005.
- Delete the Visual Studio 2005 snippets index file located at:
C:\Documents and Settings\<YOURUSERNAME>\Local Settings\Application Data\Microsoft\VisualStudio\8.0\1033\ExpansionsXML.xml
- Reopen Visual Studio 2005.
The snippet index file automatically regenerates the next time VS2005 opens.
- If the "Indexing Code Snippet folders..." message from the "Code Snippet Manager" dialog box continues to take a long time after performing the above steps, it may also be necessary to clean up any duplicate or missing directories in the Code Snippet Manager. This can be done by selecting Tools > Code Snippet Manager from the VS2005 menus. Ensure that the duplicate and missing directories (as shown with a possible error icon) are removed for all Language types by highlighting the Location folder and clicking the Remove button.