Part 3: Setting Up Visual Studio

Tutorial Navigation | Prior: Part 2: Adding the VBA Utility to ArcMap | Next: Part 4: Creating New Add-in Project

ESRI Add-ins can be created with either Microsoft’s .NET languages (C#, VB.NET, C++), or Java. This tutorial uses C# (C Sharp).

Building and testing Add-ins requires a properly configured development environment which consists of ArcGIS, Visual Studio, and the ArcObjects SDK (Software Development Kit). The SDK must be installed last, since it checks for a supported IDE (Integrated Development Environment) and installs wizards, help, and code snippets.

Install Visual Studio

If you already have a supported version of Visual Studio installed, you may skip this section.

As of this writing, the Express edition of Visual Studio 2010 is NOT supported by the ArcObjects SDK installer. In general, you can use any other edition of Visual Studio 2008 or 2010.

This tutorial will use Visual Studio C# 2008 Express, which is free and available for download from the Microsoft website.

Run the Visual Studio installer and perform a default installation. If you are new to Visual Studio or C#, you may wish to spend some time learning the IDE and language basics.

Install the ArcObjects SDK

If you have not yet installed ArcGIS Desktop 10, please do so before continuing.

Instructions

Launch the ArcGIS Desktop 10 installer. In the ArcGIS Desktop Developer Resources section click Setup for the ArcObjects SDK for the Microsoft .NET Framework.

Once the SDK installation commences, you can accept all of the defaults to complete the installation. However, if any of the VCPP (Visual C++) items are pre-selected for installation, you can set them to not install as shown below.

After the SDK installation finishes, launch Visual Studio.

A default Visual Studio Express installation will not let you choose a folder location in which to store your project source files when creating a new project (they are always stored under a root folder specified in options). This behavior can be changed by opening the Options dialog found on the Tools menu, selecting the Projects and Solutions item in the list, and checking the box next to Save new projects when created.

To check that the SDK was successfully integrated with the IDE, select New Project… from the File menu. Expand the list on the left of the New Project dialog and select the Desktop Add-Ins item to ensure the Add-in templates have been installed as shown below.

Click Cancel to close the dialog.

If the templates are not there, try re-installing the SDK. For further trouble-shooting, searching the posts in the ArcGIS Resource Center for “SDK installation” is a good place to start.

Lastly, check that the code snippets are available in Visual Studio. Select Code Snippets Manager… from the Tools menu. Check that there is an ArcObjects item listed. If not, expand this for instructions to add them (+/-)

Although the snippets are not required, they can be quite useful for common operations and starting points for further enhancement. To use a snippet, right-click at an insertion point in your code and select Insert Snippet… from the context menu. You can also browse the snippets in the Code Snippets Manager to view their descriptions.

Tutorial Navigation | Prior: Part 2: Adding the VBA Utility to ArcMap | Next: Part 4: Creating New Add-in Project

  1. #1 by Ernie on May 4, 2012 - 10:59 am

    I’m using VS10 Professional. When I right-click in my code and select “Insert Snippet”, the droppdown options are Element, Schema, Snippet, and xsd. In trying to fix this problem, I tried to navigate from my Code-Snippet-Manager to “Program Files\Microsoft Visual Studio 9.0\Common 7\IDE\VCSExpress\Snippets\ArcObjects” but find the “VCSExpress” folder does not have a “Snippets” folder inside it. The same is true if I navigate Micrsoft Visual Studio 10.0. My ArcMap SDK for .net is installed. I have reinstalled it and the VS10 in all the orders I could. I have restarted my computer every time. the necessary folders just do not get loaded. Where can I get the “Snippets/ArcObjects” folders that are suppose to reside in the VCSExpress folder so I can just copy them in there? Will that work? Any help would be appreciated.

  2. #2 by qtools_gis on May 8, 2012 - 10:34 am

    Hi Ernie,

    I suspect the snippets are installed, but not where you are looking.

    Since you are using Visual Studio 2010 Professional, the snippets are likely installed under different path then noted above for the Express edition of Visual Studio 2008. Maybe try a file search for one of the common snippets like “Cut Polygon.snippet” and then use the Snippets Manager dialog to Add the path to its parent ArcObjects directory.

    If this doesn’t help, you should post for help on the ArcObjects – All Development Languages forum over on the ESRI site.

    -Jeff

(will not be published)