ArcMap Add-in – Is It Possible to Target an Add-in to an Earlier Version

arcgis-10.0arcgis-10.3arcgis-desktoparcmaparcobjects

My development environment is Visual studio 2010 with ArcGIS Desktop 10.1 installed.
I need my add-in to support 10.0 AND 10.1. Right now, if I try to install it on ArcMap 10.0, it fails.

Is it possible to target an ArcMap add-in to an earlier version?

Best Answer

It's possible to make it work with ArcMap 10.0, but it's not easy and deployment-friendly

First, in your visual studio project, set your target framework to .NET Framework 3.5.

Then, edit the Config.esriaddinx file and modify the "Targets" section to add compatibility with ArcGIS Desktop 10.0, like this:

  <Targets>
    <Target name="Desktop" version="10.0" />
    <Target name="Desktop" version="10.1" />
  </Targets>

Finally, as described in an older post, you have to alter the ArcMap.exe.config by adding the following line inside each "dependentAssembly" block

<bindingRedirect oldVersion="10.1.0.0" newVersion="10.0.0.0"/>

Once modified, it should look like this

    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="ESRI.ArcGIS.ADF" culture="" publicKeyToken="8fc3cc631e44ad86"/>
        <bindingRedirect oldVersion="9.3.0.0-9.3.2.0" newVersion="10.0.0.0"/>
        <bindingRedirect oldVersion="10.1.0.0" newVersion="10.0.0.0"/>
      </dependentAssembly>
    </assemblyBinding>

I came to the conclusion that even if it's possible, I'm better off compiling with the lowest version of ArcMap I'm willing to support.

EDIT: See also Rich Wawrzonek's post for an alternative (not recommended by ESRI)

EDIT2: According to Esri, the best way is set up a virtual machine with 10.0 installed on it (see this post)