10.1 Add in question - can I pull in components from other DLLs?

598
1
07-20-2012 07:56 AM
JimHanks
New Contributor
I'm getting started with the 10.x add-in architecture and have made several add-ins - several extensions, toolbar buttons, etc. What I would like to do is make a single "umbrella" add-in that pulled in components from other DLLs. For example, have each extension in its own DLL for ease of development, separation of concerns, etc. and have a separate add-in reference them. I can't get this to work in the Config.esriaddinx file. I saw this thread but didn't help me.

Let's say I have the add-in configured like this
  <AddIn language="CLR4.0" library="MyNamespace.MyAddin.dll" namespace="MyNamespace.MyAddin">
    <ArcMap>
      <Extensions>
        <Extension id="MyNamespace_MyAddin_LocalExtension" class="LocalExtension" productName="MyProduct" autoLoad="true">
          <Description>Fill in later</Description>
        </Extension>
        <Extension id="MyNamespace_MyOtherProj_OtherExtension" class="OtherExtension" productName="MyProduct" autoLoad="true">
          <Description>Fill in later</Description>
        </Extension>
      </Extensions>
    </ArcMap>
  </AddIn>


This will load LocalExtension no problem since it is in MyNamespace.MyAddin.dll. But I cannot get OtherExtension to load. Note that there is another DLL, MyNamespace.MyOtherProj.dll with extension class at MyNamespace.MyOtherProj.OtherExtension.

Is this possible? If so, what's the right incantation for Config.esriaddinx to get the add-in DLL to reference the extension?

Jim Hanks
Reply
0 Kudos
1 Reply
FengZhang2
Occasional Contributor
It does not seem to be feasible only by changing the Config.esriaddinx file. This line <... library="MyNamespace.MyAddin.dll" ...> limits the file for searching the extensions.

However, you can load extension from other project by using AddIn.FromID function. Please look into the following help page for details.

-- Add-in coding patterns --
http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/Add_in_coding_patterns/...
Reply
0 Kudos