Files included in an add-in
An add-in may be composed by several assemblies and data files. Those files must be declared in the main assembly using custom attributes, or in the XML manifest.
It is important to properly declare all files used by an add-in. For example, when a type from the add-in is required (e.g. an ICommand implementation), only properly declared assemblies will be checked. This information is also used by setup tools to know
exactly what needs to be packaged when creating an add-in package.
Declaration using custom attributes
Assemblies can be included using the Mono.Addins.ImportAddinAssembly
attribute, and data files using
[assembly:ImportAddinAssembly ("SupportLibrary.dll", Scan=false)]
property can be set to false
in [ImportAddinAssembly] attributes to specify that the included assembly has to be ignored by the add-in scanner (so it won't be considered for importing extensions or extension points). The default value
Declaration using an XML manifest
File and assembly imports are declared inside the Runtime
<Addin namespace="TextEditor" id="Core" version="1.0" isroot="true">
<Import assembly="TextEditor.exe" />
<Import assembly="TextEditorLib.dll" />
<Import file="license.txt" />
<ScanExclude path="SomeLib.dll" />
<ScanExclude path="someDirectory" />
The following table describes the attributes and elements shown above:
||Contains the list of files.
||Declares that an assembly belongs to the add-in.
||Declares that a file belongs to the add-in.
||Declares that a file or directory must be ignored by the add-in scanner.
Notice that an assembly can be imported using the Import element and at the same time excluded from the scan using ScanExclude. This is useful when the assembly doesn't contain any add-in declaration, but it is still needed since it implements some add-in