-
-
Notifications
You must be signed in to change notification settings - Fork 218
Migrate your plugin to be compatible with July release
With July release of XrmToolBox, the way plugins are loaded changed to use MEF (Microsoft Extensibility Framework). This ensure that loading mechanism are handled autoamtically without any custom code.
If you developed plugins for previous versions of XrmToolBox, they won't work with July release. To update your plugins, follow this procedure:
Add references to the following assemblies:
-
System.ComponentModel.Composition
: This is the MEF part -
XrmToolBox.Extensibility
: This is a new assembly that gather all code that allows plugin development. This assembly is shipped with each new XrmToolBox release (from July 2015). Before this release is available, please download latest source code from XrmToolBox DEV branch to compile your own XrmToolBox.Extensibility assembly
Remove reference to the following assembly:
-
XrmToolBox
: There shouldn't be any need to reference this assembly anymore since all extensibility logic is contained in XrmToolBox.Extensibility assembly
Add the following Export attribute declaration to your plugin class:
[Export(typeof(IMsCrmToolsPluginUserControl)),
ExportMetadata("Name", "The name of your tool"),
ExportMetadata("Description", "The description of your tool"),
ExportMetadata("SmallImageBase64", null), // null for "no logo" image or base64 image content
ExportMetadata("BigImageBase64", null), // null for "no logo" image or base64 image content
ExportMetadata("BackgroundColor", "Lavender"), // Use a HTML color name
ExportMetadata("PrimaryFontColor", "#000000"), // Or an hexadecimal code
ExportMetadata("SecondaryFontColor", "DarkGray")]
public partial class SampleTool : PluginBase
{
// Your code here
}
Remove assembly attributes that described your plugin before:
[assembly: BackgroundColor("")]
[assembly: PrimaryFontColor("")]
[assembly: SecondaryFontColor("Gray")]
[assembly: SmallImageBase64("null)]
[assembly: BigImageBase64(null)]
public partial class SampleTool : PluginBase
{
// Your code here
}
Adjust "Using" items to remove those which referenced XrmToolBox and add XrmToolBox.Extensibility "Using" required
You should be done!
AssemblyInfo.cs
file in your project was used before to reference plugin name, plugin description, company and version. Plugin name and plugin description are not used anymore so you can put here whatever your want. Company et Version are still used.