Search code examples
c#dynamics-crm

Cannot convert from IOrganizationService to IOrganizationService


I'm trying to debug a plugin in Linqpad but running into issues trying to import the plugin assembly. I have created an IOrganizationService object in my Linqpad script and passed it to the plugin, but now I get this error:

cannot convert from 'Microsoft.Xrm.Sdk.IOrganizationService [c:\Users\meUser\AppData\Local\LINQPad\NuGet\Microsoft.CrmSdk.CoreAssemblies\Microsoft.CrmSdk.CoreAssemblies.8.2.0.2\lib\net452\Microsoft.Xrm.Sdk.dll]' to 'Microsoft.Xrm.Sdk.IOrganizationService [c:\Users\meUser\Documents\dynamics\MyPlugin.Plugins\bin\Debug\MyPlugin.Plugins.dll]'

I've double checked that the version of the Microsoft.Xrm.sdk.dll matches in the Linqpad script and the plugin, what am I doing wrong?


Solution

  • Don't ILMerge the Microsoft DLLs. You shouldn't need to do that because they are available on the CRM server. It is causing a type mis-match.