Another week, another challenge from Guido “Future Olive Farmer” Preite:
I created a plugin for one Online instance (version 18.104.22.1682), I created a class library project with .NET 4.5.2 and with nuget I installed the Microsoft.CrmSdk.CoreAssemblies version 22.214.171.124
I registered the plugin and I always get this error:
Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=126.96.36.199, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: System.ArgumentNullException: Value cannot be null.
After checking the plugin code I decided to downgrade the nuget package to 188.8.131.52 and the plugin worked perfectly after. Beside the .NET 4.5.2, for Plugins, do we need to start to be careful to match the nuget version based on the Instance version? Or is it a bug in the latest SDK?
Nope, no bug, all is by design. You can’t get a more authoritative response than the one from Matt “SDK Deity” Barbour:
You cannot use a higher version of the SDK for a lower version of the server for plugins
Thus 8.x servers need to use 5 – 8.x assemblies. Where as 9.x servers need to use 5 – 9.x SDK assemblies.