Registering CRM Plugin to run on Offline Client involves more than just ticking the Offline checkbox when registering Step on Plugin Registration Tool.
Other things to consider are:
1. Assembly Security
2. Modifying your plugin code to support offline execution
In this post, we will just look at the first item, Assembly Security. The reason we need to do this is because MSCRM platform applies an additional security restriction to offline plugin assemblies. The plugin assemblies need to be added to AllowList, otherwise you will receive an exception with message similar to the following ‘Public key token c25bf78a1af6a09f is not found in allow list’.
To register this plugin we need to do 2 things:
1. Obtain public key token of plugin assembly
2. Add an AllowList Key to the registry
Obtaining public key token
You can just copy and paste the public key token from Plugin Registration Tool.
But you can also add an external tool into Visual Studio. There is a fantastic post by Jeremiah Clark here.
Add an AllowList Key
You can use regedit.exe to add a new Key to
HKEY_CURRENT_USER\Software\Microsoft\MSCRMClient\AllowList. Paste the public key token as the name of the new key.
Or just run this batch file, replace with the public key token you have obtained.
REG ADD HKEY_CURRENT_USER\Software\Microsoft\MSCRMClient\AllowList\<public key token> /F
That’s it for the assembly security.
MSDN has a walkthrough that I based this post one. Read here.
Cheers – Sy