PROBLEM

Convert a version 2.0 to 2.4 ArcGIS Pro SDK add-in solution to 2.5 and later versions

Last Published: May 20, 2021

Description

In version 2.5, ArcGIS Pro has changed its Minimum .NET Target from 4.6.1 to 4.8. If code changes are made to an add-in previously created in version 2.0 through 2.4, compiler errors are returned when build is attempted, as shown in the following image:

Compiler errors shown in the Error List

The assembly references for ArcGIS Pro may also show as broken:

The broken ArcGIS Pro references in Visual Studio

Cause

In version 2.5, the minimum .NET Target Framework has been changed to 4.8. To recompile an add-in, previously created in version 2.0 through 2.4, using version 2.5 or later, the 'Target framework' must be changed in the Application Properties to .NET Framework 4.8.

Solution or Workaround

  1. Open the .csproj or .vbproj Project Properties in Visual Studio.
  2. Select the Application tab, if not already selected.
  3. In the Target framework drop-down list, change the selection from .NET Framework 4.6.1 to .NET Framework 4.8.
Selecting .NET Framework 4.8 from the drop-down list of Target framework in the Application tab.
  1. If Visual Studio prompts with a Target Framework Change warning, click Yes.
Clicking Yes at the Target Framework Change warning prompt.
  1. Ensure the Target framework is now set to .NET Framework 4.8.
Checking the Target framework is showing .NET Framework 4.8 in the Application tab.
  1. Open the add-in Config.daml.
  2. Change desktopVersion at the end of the line <AddInInfo ... desktopVersion="2.0.0" from its current value to the desired version of ArcGIS Pro. The example below is for ArcGIS Pro 2.5:
<AddInInfo id="{...}" version="1.0" desktopVersion="2.5">
Note:
The release and build number components of the desktopVersion are not important.
  1. Rebuild the add-in.
Note:
Visual Studio may require a restart to clear any broken links shown in the ArcGIS Pro assembly references.

Article ID:000022645

Software:
  • ArcGIS Pro 2 x

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Discover more on this topic