A commonly disregarded feature of MS CRM 2011 is the ability to manage different versions of a plugin assembly to control how new releases of an assembly are rolled out to the CRM system and how it affects existing plugins and custom workflow activities. When you build a plugin assembly you can specify the version (in the strong name) as Major.Minor.Build.Revision and there are two key features in CRM that can be leveraged when you build a new version of an existing assembly:
This feature is particularly targeted to updates in the plugin assembly which are back-compatible with your existing plugin assembly and typically address the following:
- Bug fixes
- Minor changes in the implementation of a plugin or custom workflow activity
In order to use the assembly update feature, you must re-compile your assembly an use a new Build/Revision number, but leave the same Major/Minor version. You can then use the Plugin Registration Tool and select “update” on the plugin assembly. These are the advantages of assembly update:
- New assembly content takes effect immediately after updating the assembly.
- All existing plugin steps and workflows that use the assembly will automatically start using the new version without any additional configuration (even workflows that are suspended will automatically switch to the new version when resumed).
- No need to restart IIS/AsyncService regardless of whether the assembly is registered on disk, GAC or database.
Note that this feature requires the strong name of the plugin assembly to be exactly the same except for the build and/or revision number.
Assembly upgrade can be used to register a new version of the assembly and have both the old and the new version running side-by-side. This feature is typically used in the following scenarios:
- Adding input/output parameters to custom workflow activities
- Changing signature of the plugin types
- Changes to plugins that are not back-compatible with the previous version.
In order to upgrade a plugin assembly, you must update the Major and/or Minor version of your plugin assembly and register it in CRM as a new assembly (therefore you will have both versions running side by side). Once you register the new assembly you must perform the following actions in order to start using the upgraded version:
- For plugins: Manually re-parent the old plugin steps to the new assembly as required.
- For workflows: Workflows will not automatically use the upgraded version until you explicitly change the version number in the workflow definition. For each workflow that you want to upgrade, you need to de-activate it, edit the custom workflow activity step, select the appropriate version from the drop-down and re-activate the workflow. Existing running instances of the previous workflow will continue to use the old version (e.g. workflow instances that are waiting or suspended will still use the old version when resumed). The upgraded version will only apply to new workflow instances.
Note that the new version will only appear in the workflow designer version drop-down list if the new assembly has the exact same strong name except for the major and/or minor version.