On creating a new plugins project for our Dynamics 2015 organisation with the latest version of the Dynamics 365 Developer Toolkit we were experiencing all sorts of errors, either on deployment or on execution.
On trying to register a plugin with IsolationMode=”None” we would experience this error:
System.IO.FileLoadException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #156BBD18
Registering plugins in Sandbox isolation mode would work, but the plugins would fail on execution with this error:
SandboxAppDomainHelper.Execute: The plug-in type could not be found in the plug-in assembly
System.ArgumentNullException: Value cannot be null.
Trying to delete or re-register the step would give us this error:
Unable to load the plugin type
The issue turned out to be that, by default, the toolkit downloads the latest version (126.96.36.199) of the Microsoft.CrmSdk.CoreAssemblies package from NuGet, and this is a higher version than can be used by Dynamics CRM 2015. In order to fix this issue, we just downgraded the package using the NuGet Package Manager:
This fixes the problem and plugins will now work in either Sandbox or ‘None’ isolation mode.