Add ArcGIS Runtime SDK references
In this topic
In order to work with ArcGIS Runtime SDK for .NET using Visual Studio, you will need to reference the assembly in your project and also add any required XML namespace references in your XAML. This process is not unique to ArcGIS Runtime SDK for .NET, you will follow it for any additional assembly you want to use in your project.
The following steps guide you through creating a new
Visual Studio project
for your Windows Desktop application. You will also learn how to add the proper project and namespace references for working with ArcGIS Runtime SDK for .NET classes. You can follow these same basic steps for every
ArcGIS Runtime SDK for .NET project you create.
ArcGIS Runtime SDK for .NET provides a project template for creating your mapping app, called ArcGIS Runtime 10.2.7 for .NET App. Creating your project from the template will add the appropriate references and a page with a map view containing a single base layer. In this tutorial, you'll build your app from a blank template.
Create a WPF app
You'll use Visual Studio to create a WPF app.
- Open a supported version of Microsoft Visual Studio.
File > New > Project(or click
New Projecton the
Startpage) to create a project.
Windows Desktop > WPF Applicationin the
New Projectdialog box (you can create your project in either C# or VB .NET).
Visual Studio 2015 organizes project types slightly differently. You'll find WPF Application projects under
Windows > Classic Desktop
If you decide to use the ArcGIS Runtime template, you will not need to complete the steps described in this topic.
- Choose a folder location for your new project and give it a name.
OKto create the project.
Your project opens in Visual Studio and contains a single WPF window called
Add a project reference to ArcGIS Runtime
When you create a new project from one of the standard templates, Visual Studio does not know about the ArcGIS Runtime. To use the ArcGIS Runtime classes, you must add a reference to the ArcGIS Runtime assembly in your project.
- Right-click the
Referencesnode under your project listing in the Visual Studio Solution Explorer window, and click
Add Referencein the context menu.
- Check the listing for the
Assemblies > Extensions.
OKto add the reference to ArcGIS Runtime for .NET.
Add XML namespace references
In addition to the project reference you made to the ArcGIS Runtime assembly, you must also add an XML namespace reference in your XAML page (MainWindow.xaml, e.g.).
- Open the
MainWindow.xamlfile in the
- Go to the
XAMLview of the designer and add the following XML namespace reference to the
Visual Studiooffers Intellisense to help complete the URL portion of the statement.
- You can now use the XML prefix you've defined to work with ArcGIS Runtime SDK objects in your XAML. The following code sample defines a new
Mapcontaining a single basemap layer.
<esri:MapView x:Name="MyMapView"> <esri:Map x:Name="MyMap"> <esri:ArcGISTiledMapServiceLayer ID="BaseMap" ServiceUri="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"/> </esri:Map> </esri:MapView>
http://schemas.esri.com/arcgis/runtime/2013namespace. They can now be referenced in your page using the
The process described in this topic is generally the first thing you'll do for each
ArcGIS Runtime SDK for .NET project you create from a standard Visual Studio template. The details for adding these references differ slightly between SDK platforms.