I am writing addins in C#, and am trying to load an addin. I thought i had the solution, but it seems like the full code is not loaded.
The button is added to my toolbar, and code seems to run, too a point. Once i need to use the singleton extension of the child, it crashes.
The child addin will run by itself, with no issues.
Calling Addin (Parent):
public class ParentExten : Extension
{
.....
/// <summary>
///
/// </summary>
protected override void OnStartup()
{
WireDocumentEvents();
// load other extensions:
// Call FindExtension to load this just-in-time extension.
var ais = ArcMap.Application.FindExtensionByName("ChildExtension");
}
}
Child Addin: config.esriaddinx
<AddIn language="CLR4.5" library="name.dll" namespace="name">
<ArcMap>
<Extensions>
<Extension id="childExtension" class="classname" showInExtensionDialog="true" autoLoad="false" />
</Extensions>
<Commands >
<Button id="button_id" class="namspace.classname"
image="Images\Layer.jpeg" onDemand="true"/>
<Tool id="tool_id" class="hiddenname"
category="Layer" image="Images\Layer.jpeg" onDemand="true" />
</Commands>
</ArcMap>
</AddIn>