-
Notifications
You must be signed in to change notification settings - Fork 353
ProConcepts Working With Previous Versions of ArcGIS Pro
Language: C# and Visual Basic
Subject: Framework
Contributor: ArcGIS Pro SDK Team <[email protected]>
Organization: Esri, https://www.esri.com
Date: 10/31/2024
ArcGIS Pro: 3.4
Visual Studio: 2022
- Working with the latest version of ArcGIS Pro and ArcGIS Pro SDK
- Using GitHub branches to get samples for an earlier version of ArcGIS Pro
- Back porting a new sample for an earlier version of ArcGIS Pro
The samples in the arcgis-pro-sdk-community-samples repository have been tested against the compiler and .NET Framework version specified on the sample's readme.md document in the shipping label section of the readme file. The shipping label also contains the minimum ArcGIS Pro version capable of running the sample add-in. The following is an example of a shipping label showing the compiler, .NET Framework version, and minimum ArcGIS Pro version.
The sample shipping label above indicates that MapToolWithCustomPopup requires Visual Studio 2015, C# 6.0, .NET Target Framework 4.6.1, and at least ArcGIS Pro 2.4 to build the sample using Visual Studio. The built sample can then be used with ArcGIS Pro 2.4 or later as long as the ArcGIS Pro version is a 1.x release (i.e., 2.1, 1.5) and not a 2.x or later release. The community samples repository is usually updated to work with the latest versions of ArcGIS Pro and ArcGIS Pro SDK; however, developers who want to develop add-ins for earlier releases of ArcGIS Pro can follow the steps described below.
Note: When developing add-ins for an earlier version of ArcGIS Pro (i.e., 1.2), your development environment requires that the same earlier version of ArcGIS Pro (i.e., 1.2) is installed on your development machine. The development system must also satisfy the ArcGIS Pro SDK requirements for the installed version of ArcGIS Pro as outlined here.
In a case where a shipping label for a sample in arcgis-pro-sdk-community-samples shows a later version of ArcGIS Pro than what you're using, the following two solutions are available:
- Use the repository's GitHub branches to get samples for the earlier version of ArcGIS Pro.
- Use the latest sample, and back port the sample to the earlier version of ArcGIS Pro as shown here.
The arcgis-pro-sdk-community-samples contains multiple releases of the ArcGIS Pro SDK sample code and dataset. The source code and documentation for samples can be accessed by changing the branch to a branch name that contains the desired ArcGIS Pro version (using the Branches drop-down menu) as shown here:
Once the branch has been changed to the desired release, the documentation and sample source code show now the content for that release. Now the source code and all associated instructions for the desired release can be viewed. Note that the GitHub branch names contain the release version number as part of the name, usually proceeded by the letter "v".
The following screen shot shows a specific sample's readme file with the shipping label's ArcGIS Pro version matching the GitHub branch version.
Sample data provided by the community samples repository does sometimes depend on a specific release version of ArcGIS Pro and is therefore not always backward compatible. To download the sample data for a desired version of ArcGIS Pro, use the release tab and scroll down to find a release tag that matches the ArcGIS Pro version you're looking for.
You can back port any given sample to your release of ArcGIS Pro as long as the major version number is the same (for example, 1., as in 1.2, 2.1, 2.4). When back porting sample source code, you have to change the .NET Target Framework version first (check the requirements for the supported .NET Framework for your ArcGIS Pro release). Next, in a case where your compiler doesn't understand C# 6.0 syntax, you need to replace any 6.0 syntax with the C# 5.0 compatible version. Finally, you have to set the desktopVersion attribute in the config.daml file to your version.
<ArcGIS defaultAssembly="RenderingAddin.dll" defaultNamespace="RenderingAddin" ...>
<AddInInfo id="{1b1edeb7-c574-4719-b067-db260f3246cd}" version="1.0"
desktopVersion="2.4.5747">
<Name>RenderingAddin</Name>
...
</AddInInfo>
...
</ArcGIS>
Note: The ArcGIS Pro API is enhanced with each new release; consequently, a sample cannot be back ported if a required API feature doesn't exist in an earlier version of ArcGIS Pro.
Note: If your add-in is not loaded properly by ArcGIS Pro, you can diagnose any issues in this ProGuide: Add-in not loaded by ArcGIS Pro after building it in Visual Studio.
Home | API Reference | Requirements | Download | Samples