FAQ: What are some best practices for developing .NET add-ins for different versions of ArcMap?
What are some best practices for developing .NET add-ins for different versions of ArcMap?
When developing add-ins, it is vital to ensure the add-in runs as expected in different versions of ArcMap. This article discusses some best practices to ensure add-ins work successfully in more than one version of ArcMap.
A. Compile the add-in in the oldest version of ArcMap that supports add-in installation
Since add-ins are designed to be forward compatible, compiling an add-in in ArcMap 10.1 allows the add-in to be used in ArcMap 10.2, 10.3, and 10.4, and so forth. The steps below help to ensure add-ins can be built successfully in newer versions of ArcMap.
- In the Config.esriaddinx file, update the line, as shown in the example below, by changing the version number to the current version of ArcMap used.
Code: <Targets><Target name="Desktop" version="10.1" /></Targets>
- Select all Esri references in the Solution Explorer of Visual Studio, and right-click the selected references.
- Set the Specific Version property to 'False' for the references.
Warning: Add-ins do not work in newer versions of ArcMap if there are major changes in the add-in project's dynamic link library (DLL) files.
B. Test the add-in in separate testing environments to confirm that the add-in works in different versions of ArcMap
The add-in compiled in ArcMap 10.1 can be tested on separate machines installed with ArcMap 10.2, 10.3, or 10.4 to check whether the add-in works as expected. However, it is not possible to install separate versions of ArcMap products side-by-side. If testing cannot be done on separate machines, it is best to have virtual machine (VM) snapshots for each version test.
C. Commonly encountered .NET add-in issues
- Problem: Unable to generate add-ins when migrating from older to newer versions of Visual Studio
- Problem: Changes are not made to updated versions of an add-in installed in ArcMap
- Problem: Unable to hit breakpoints when debugging ArcGIS add-in projects in Visual Studio
- Error: Building Add-in Project using MSBUILD command line causes error MSB4036
- Error: No GUI components found in this Add-In. Add-In version does not match
- Error: Managed Debugging Assistant 'PInvokeStackImbalance' has detected a problem in...
- ArcObjects Help for .NET: Building add-ins for ArcGIS for Desktop
- ArcObjects Help for .NET: Advanced add-in concepts
- ArcObjects Help for .NET: How to debug add-ins
- ArcObjects Help for .NET: Sharing add-ins