Configuring a Module to Load an Addin
- Last UpdatedNov 27, 2024
- 2 minute read
Having written an addin the next step is to get it to be loaded by a module. Each Common Application Framework (CAF) based application has an XML addin configuration file which contains a list of the addins that the application should load at startup. The default location for this file is in the same directory as the application executable. It has a filename of the form <Module Name>Addins.xml. For example, Model has a file called DesignAddins.xml. The content of this file is reproduced below. By default the addins are also expected to be in the same directory as the application executable. You can however specify the full path to the addin assembly including the use of UNC pathnames. If during addin development you do not wish to modify the addin configuration file in the install directory (this is particularly likely to be the case if you are using a server based installation) then the default location of the addin configuration file can be overridden using the environment variable CAF_ADDINS_PATH. You can then edit a copy of the file and point this environment variable at the directory you copy it to.
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfString xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<string>ExplorerAddin</string>
<string>DrawListAddin</string>
<string>MyDataAddin</string>
<string>HistoryAddin</string>
<string>ReferenceListAddin</string>
<string>PipeCheckAddin</string>
<string>OutputAddin</string>
<string>FindAddin</string>
<string>AttributesAddin</string>
<string>C:\Documents and Settings\User1\My Documents\Visual Studio\AttributeBrowserAddin\AttributeBrowserAddin\bin\Debug\AttributeBrowserAddin</string>
</ArrayOfString>
Note:
You can add an attribute to disable an addin.
For example: <string disabled="true">OutputAddin</string>.
Important:
Disabling an addin may lead to application malfunctions or crashes, especially if
another addin relies on the one you have disabled.