Using the ArcGIS Explorer samples


Summary
The ArcGIS Explorer software development kit (SDK) contains a number of samples. When necessary, a ReadMe file is included with a sample.
This topic outlines the common tasks associated with working with samples, including opening the solution, compiling the sample, setting it up for debugging, running it, and removing it when you're done.

In this topic


Visual Studio settings—The first time you start Visual Studio, you're prompted to choose development settings. Choosing different settings changes the options displayed in Visual Studio. Unless specified, dialog boxes and menu commands discussed in this topic are defined based on the general development settings in Visual Studio 2008 Professional Edition.

Opening solution files

In Windows Explorer, browse to the sample's location on disk: <Your ArcGIS Explorer install location>\DeveloperKit\Samples, with the folder name in the ReadMe file. Open the C# or VB.NET version, and double-click the solution file (.sln) to open in Visual Studio.
If you're working in Windows Vista or Windows 7 with a sample that creates a dynamic-link library (DLL), you need to run Visual Studio as an administrator. You can do this by going to Start Menu > All Programs > Microsoft Visual Studio, right-clicking the Visual Studio application, and selecting Run as administrator from the context menu. Then open the solution file from within the integrated development environment (IDE). 
If you're working with a sample that was downloaded from the ArcGIS Resource Center Web site, the ReadMe files are located where you saved the ZIP file.

Compiling samples

In the opened Visual Studio solution for the sample, choose Build Solution from the Build menu.

Debugging samples

This task is optional, as samples do not require debugging. However, stepping through the code of the sample to see what it is doing can be beneficial.
Each sample is a class library that, when compiled, creates a DLL file. To debug a DLL, start by debugging the calling application (in this case ArcGIS Explorer) as described in the following steps:
  1. Select the Project menu, and click the <project name> Properties item at the bottom of the list.
  2. Click the Debug tab.
  3. Ensure that the Configuration is set to Debug; that is, Active (Debug).
  4. Select the Start external program radio button under Start Action, and enter the path to the Explorer executable (E3.exe), which is located in the <your ArcGIS Explorer install location>/bin folder (for example, C:\ProgramFiles\Explorer\bin\E3.exe).
Before you start debugging the calling application, you can set a breakpoint in the class library. When the breakpoint is hit, step through the code, observing the action at each line, until you isolate the problem.
If you're using Visual C# Express Edition or Visual Basic Express Edition, you cannot debug DLLs because these versions do not have the option to start an external application for debugging.

Running samples

Now that you have opened and compiled the sample, it is ready to use. As part of the Explorer add-ins compilation process, the output DLL file, the AddIns.xml file, and any other supporting files in the solution are automatically packaged into a .eaz file that is then copied to a well known location on disk. When you start the ArcGIS Explorer application, compiled samples appear under the Add-Ins tab.
The well known locations for add-ins are as follows:
  • For XP: C:\Documents and Settings\<user name>\Application Data\ESRI\arcgis explorer\AddIns
  • For Vista and Windows 7: C:\Users\<user name>\AppData\Roaming\esri\arcgis explorer\AddIns

Removing samples

When you're finished with a sample, you can remove it from ArcGIS Explorer in two ways. You can remove the sample from the ArcGIS Explorer application by opening the ArcGIS Explorer Options dialog box, clicking the Resources tab, then clicking Manage Add-Ins. Alternatively, you can remove the sample by removing the .eaz file from the well known location on disk (see the Running samples section).