English

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

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.

Last Published: 5/19/2021

Article ID: 000022645

Software: ArcGIS Pro 2.5.2, 2.5.1, 2.5, 2.4.3, 2.4.2, 2.4.1, 2.4, 2.3.3, 2.3.2, 2.3.1, 2.3, 2.2.4, 2.2.3, 2.2.2, 2.2.1, 2.2, 2.1.3, 2.1.2, 2.1.1, 2.1, 2.0.1, 2.0