ArcGIS Explorer SDK Feedback via the User Forum
Programming with the E2API

Glossary Item Box

Troubleshooting E2API programming issues

Below are pointers to the most common problems experienced when programming and compiling custom task projects.

Troubleshooting Compilation Problems

  • 'Type not defined' error

    If you recieve an error about an E2API type not being defined (for example '<Type> is not defined'), check that your E2API reference is set correctly. Open the Solution Explorer, select the ESRI.ArcGIS.E2API reference, and check that its CopyLocal and Specific Version properties are both set to False, and the Path property points to the correctly location of your E2 installation on disk. If any properties are incorrect, you may wish to remove the reference, save the project, then add the reference in again, and then ensure you set the CopyLocal and SpecificVersion properties to False.

    The CopyLocal and SpecificVersion properties together can help ensure you are always using the correct E2API assembly. If CopyLocal is true, VS will copy the E2API reference to the project directory and use that copy to build your project. This means that if you install an updated version of ArcGIS Explorer, then the new E2 reference would not automatically be used; setting CopyLocal to False will ensure the original reference is used to build your each time.

    By default, Visual Studio stores the full strong name information of a strongly named assembly reference, including version information; if any part of the strong name of the assembly on disk changes, Visual Studio will then mark the reference as broken, and the project will fail to compile. Setting the SpecificVersion property to False tells Visual Studio to ignore any changes in the version number of the assembly; this means that if you install a new version of ArcGIS Explorer, the new E2API assembly version will automatically be used to build your project.

  • 'The referenced component 'ESRI.ArcGIS.E2API' could not be found' error

    If you attempt to compile your project and get an error indicating that the E2API reference cannot be found, then check that the reference is not broken. In Solution Explorer, uncollapse the References node; if the reference is currently broken then it will be displayed with a yellow warning triangle. In this case, try removing and re-adding the reference, and ensure the CopyLocal and SpecificVersion properties are set to False (see above for more information). This error may often occur if your reference had SpecificVersion set to True, and then you install a newer version of ArcGIS Explorer and then re-open your custom task project.

Troubleshooting Behavioural Problems

Below you can find more tips on troubleshooting problems in your running code.

  • If you have problems displaying layers or results on target machines, this may be because you have used symbols contained in a non-default style file. ArcGIS Explorer installs a default style file; if you have additional style files on your development machine and are using symbols from those files, you should additionally deploy the required style files. See the help topics on the StyleManager class for more information about using styles in the E2API.
  • If you are performing a lengthy operation in a Task class (and therefore on a background thread), but find that the mouse cursor for the application changes to an hourglass while the task is executing, you may wish to check your usage of PlaceResults. Drawing many results can sometimes take a while, particularly if the results are being draped on the surface of the globe, as elevation values must be determined for each result before it can be drawn. Try setting the Visible property of the PlaceResults to False, and allowing users to show each result individually.

Getting more help

If the tips above have not helped you to troubleshoot your problems, you may wish to visit the following resources: