Tuesday 29 November 2016

ArcGIS and .Net compatibility (Extending ArcObjects)



Backstory


Historically, when compiling a custom dll that extends ArcObjects you would compile on a PC with the lowest compatible version of ArcMap installed, for example 10.1. Then that custom extension would work on ArcMap 10.1 and up until ESRI issues a new release that is a breaking change. If you compiled on a higher version of ArcMap (say 10.5) and then tried to register it on a PC with a lower version of ArcMap (say 10.3.1) it would not work.



  • ArcMap 10.1 - 10.3.1 targets .Net 3.5 by default but can be changed to target .Net 4.0

  • ArcMap 10.4 and up targets .Net 4.5.


What puzzles me:


If I compile my custom dll extension with ArcMap 10.1 installed, my assembly has to target .Net 3.5. But it still runs on ArcMap 10.4 and up which targets .Net 4.5.


Today, I compiled my custom extension targeting .Net 4.6.1 on ArcMap 10.5 and then installed it on an ArcMap 10.3.1 PC - expecting it to never even pass the ESRIRegasm.exe process - but it did and it all seems to work.


Question



Does anyone have a compatibility chart of some kind that shows what versions of ArcMap and .Net a custom extension that extends ArcObjects will work with including forward and backward compatibility of both? I've looked and can only seem to find what each version on it's own supports, but that seems to contradict my findings above.


Below is a sample of what I'm looking for



  • Assembly targeting .Net 3.5 compiled on ArcMap 10.1 works on ArcMap 10.1 - 10.5.1

  • Assembly targeting .Net 4.0 compiled on ArcMap 10.1 works on ArcMap 10.1 - 10.5.1

  • Assembly targeting .Net 4.5 compiled on ArcMap 10.4 works on ArcMap ?

  • Assembly targeting .Net 4.6.1 compiled on ArcMap 10.5.1 works on ArcMap ?

  • and so on...



Answer




I submitted a link to this question to my ESRI representative and they submitted it to ESRI development for an answer. The answer I got back was as follows:



"We [ESRI] don’t technically support compiling a single binary and deploying it to different versions of the platform. It works much of the time but the supported workflow if to compile and test your code for the version you want to deploy to. Behavior and binary compatibility can change from release to release and there is no guarantee that your extension will work. It works mostly because ultimately these are COM objects and Desktop will discover older customizations. Many people have relied on this “feature” and it could be problematic.


As far as I know with the .NET framework your extension should work as long as the version of the Framework is on the machine. I don’t know what the minimum version and requirements are nowadays. You could run into other issues (which should be fairly rare) but we only certify specific versions of the .NET framework. So, for example using .net 4.6.1 with 10.3.1 will probably work fine, its not certified and if it doesn’t work Esri will not fix it."



So basically the compatibility table that I was looking for does not exist.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...