Dependencies of an add-in

Add-ins must explicitly declare dependencies on add-in roots or other add-ins. Dependencies are specified using the add-in identifier and the version number. The dependency will be satisfied if the add-in engine can find an add-in with the same or greater version number (unless the CompatVersion attribute of that add-in is also set to a greater version).

Dependencies can be declared using the Mono.Addins.AddinDependency attribute:

[assembly:AddinDependency ("TextEditor.Core","1.0")]

If the referenced add-in belongs to namespace, that namespace has to be included in the identifier used in the reference, unless the referencer add-in belongs to the same namespace. For example, the above declaration is equivalent to:

[assembly:Addin (Namespace="TextEditor")]
[assembly:AddinDependency ("Core","1.0")]

If the referenced and referencer add-ins belong to different namespaces, the "::" prefix can be used to specify that an identifier is absolute and should not be prefixed with the referencer namespace:

[assembly:Addin (Namespace="AwesomeExtensions")]
[assembly:AddinDependency ("::TextEditor.Core","1.0")]

Notice that without the "::" prefix, the reference id would be interpreted as "AwesomeExtensions.TextEditor.Core".

Declaration using an XML manifest

Dependencies are declared in the Dependencies element:

<Addin namespace="TextEditor">
		<Addin id="Core" version="1.0" />

The following table describes the attributes and elements shown above:

XML Description
/Addin/Dependencies Contains the list of dependencies.
/Addin/Dependencies/Addin Declares a dependency.
/Addin/Dependencies/Addin/@id Identifier of the extended add-in.
/Addin/Dependencies/Addin/@version Version of the extended add-in.

The rules explained above about namespace and reference id composition also apply when declaring dependencies using an XML manifest.

Last edited May 10, 2010 at 11:34 PM by slluis, version 1


No comments yet.