Dynamics CRM 2015 - 无法找到插件类型

时间:2015-07-23 23:48:08

标签: c# dynamics-crm dynamics-crm-2015

我遇到了一个非常类似的问题:

Dynamics CRM 2011 - The plug-in type could not be found

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: System.ArgumentNullException: Value cannot be null.
Parameter name: The plug-in type could not be found in the plug-in assembly: Enlighten.CRM.Customisations.Job.CreateJobDetail: 
<OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
  <ErrorCode>-2147220970</ErrorCode>
  <ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
    <KeyValuePairOfstringanyType>
      <d2p1:key>CallStack</d2p1:key>
      <d2p1:value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">   at Microsoft.Crm.Sandbox.SandboxAppDomainHelper.Execute(IServiceEndpointNotificationService serviceBusService, IOrganizationServiceFactory organizationServiceFactory, String pluginTypeName, String pluginConfiguration, String pluginSecureConfig, IPluginExecutionContext requestContext)
   at Microsoft.Crm.Sandbox.SandboxAppDomainHelper.Execute(IServiceEndpointNotificationService serviceBusService, IOrganizationServiceFactory organizationServiceFactory, String pluginTypeName, String pluginConfiguration, String pluginSecureConfig, IPluginExecutionContext requestContext)
   at Microsoft.Crm.Sandbox.SandboxWorker.Execute(SandboxCallInfo callInfo, SandboxPluginExecutionContext requestContext, Guid pluginAssemblyId, Int32 sourceHash, String assemblyName, Guid pluginTypeId, String pluginTypeName, String pluginConfiguration, String pluginSecureConfig, SandboxRequestCounter&amp; workerCounter)</d2p1:value>
    </KeyValuePairOfstringanyType>
  </ErrorDetails>
  <Message>System.ArgumentNullException: Value cannot be null.
Parameter name: The plug-in type could not be found in the plug-in assembly: Enlighten.CRM.Customisations.Job.CreateJob</Message>
  <Timestamp>2015-07-23T23:32:27.2903692Z</Timestamp>
  <InnerFault i:nil="true" />
  <TraceText>

[Enlighten.CRM.Customisations.Job.Deploy: Enlighten.CRM.Customisations.Job.CreateJob]
[d2c5efd5-452b-e511-80c4-00155d00461a: Opportunity Create]


</TraceText>
</OrganizationServiceFault>

这是我在CRM 2011中使用的现有插件。主要区别在于我使用nuget包更新了SDK以对抗7.0.0.1。

https://www.nuget.org/packages/Microsoft.CrmSdk.Extensions/7.0.0.1

之前的问题表明它是版本差异,但据我所知,我的部署是一个更新的版本(如下面的部署管理器中所示),因此SDK版本应该不是问题。

Organisation version

有什么想法吗?

2 个答案:

答案 0 :(得分:1)

我建议您使用CRM版本的相应SDK中提供的程序集。

如果要将插件部署到CRM 2011环境,则仍应使用2011 SDK中提供的程序集。 (即版本5. 。*)

答案 1 :(得分:0)

这听起来像是隔离模式的问题和/或正确加载相关的dll。

如果您在注册插件时使用 Sandbox 隔离模式,则需要确保在注册插件程序集之前将所有依赖项与ilmerge合并。

如果您的隔离模式为,请确保程序集位于 GAC 中或放在 bin \ assembly 文件夹中服务器上的CRM安装目录。