Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Dependencies of an add in

slluis edited this page Nov 20, 2014 · 3 revisions
Home > Reference Manual > Description of Add ins and Add in Roots > 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:Addin]
[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">
	...
	<Dependencies>
		<Addin id="Core" version="1.0" />
		...
	</Dependencies>
	...
</Addin>

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.

Clone this wiki locally