10

I support a .NET application that has been compiled on a PC with ArcGIS 10.1 installed. The application comprises a user interface and an ArcGIS desktop extension, plus an installer assembly that is called by Windows Installer to register the desktop extension during installation.

The problem I have is that the application won't run on a PC with ArcGIS 10.2 because the 10.1 ESRI assemblies are not found so it crashes. It seems that since v9.3 ESRI no longer supply publisher policy files any more to redirect the program at runtime to the latest versions.

I have managed to redirect the program to load the 10.2 assemblies by adding runtime assembly binding into the application's .exe.config. However, this doesn't redirect the desktop extension and won't solve the problem with the installer looking for the 10.1 libraries when installing the application.

ESRI's solution seems to be to re-compile the application every time a new version of ArcGIS is released. However, this means I would need to have a copy of every release of ArcGIS that the end users are using. And I'd have to uninstall and re-install different versions every time I need to change the application code in order to re-compile it.

Does anyone have any suggestions? Can the libraries be loaded dynamically at runtime to avoid looking for a specific version? Is there any other solution?

2 Answers 2

2

Set the ArcGIS references in your project to use the following properties:

Copy Local = False
Specific Version = False

In most cases this will make your program forward compatible assuming you aren't using any arcobjects that were deprecated or have breaking changes.

1
  • I already have these settings in Visual Studio. 'Specific Version = False' only affects how Visual Studio loads the references, not once an application is built and deployed.
    – Andy
    Commented Aug 19, 2014 at 8:09
2

It may be best for you to change your project architecture to an ESRI Add-In. That way you will avoid dealing with the Windows Installer that, if I understand your architecture correctly is dealing with the windows registry.

Add-Ins are much more straight forward, don't require windows specific installers, they are just shipped as a special .zip file that is the .esriAddIn file type, and are what are recommended by ESRI. These don't deal with the windows registry, only ESRI and install with one click of the file. They should better enforce the changes that Rich Wawrzonek has suggested.

Additionally ESRI has stated (see in presentation here) that within major versions i.e. 10.x Add-Ins are backwards compatible, i.e. 10.2 can use 10.1 and 10.0 Add-Ins, 10.1 can use 10.0 Add-Ins. With the caveat that you should be aware if things have been removed or changed in ArcObjects when transitioning.

For example the method signature for the OnContextMenu method has been changed in 10.2 for the following interfaces:

  • IDocumentEvents
  • IGxDocumentEvents
  • IGMxDocumentEvents
  • ISxDocumentEvents

As far as removals the only removals in 10.2 were:

  • MaplexUI
    • MaplexExtension
    • MaplexExtensionClass

The rest of the changes were added functionality.

To answer your question in the comments below, Yes this should guarantee that you do not have to compile for different versions of Arc (as long as you remain in 10.x). When they make the shift to 11 this may be a different story. As far as supporting MapInfo, I am not familiar with this.

2
  • Thanks for the suggestion but I have two thoughts: 1. Does this guarantee to get round the issue of DLL versions or will the add-in still need to be recompiled for each version of ArcGIS? The problem is not with the installer or registry - the problem is that ESRI no longer provide publisher policy files with new releases. 2. My application is not just for ArcGIS, it also works with MapInfo. So the bulk of the application is a standalone interface and only a small part of the code relates to ArcGIS or MapInfo.
    – Andy
    Commented Aug 20, 2014 at 8:09
  • Andy see the additions to my answer to address your concerns.
    – GeoSharp
    Commented Aug 29, 2014 at 17:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.