C# 注册Dynamics CRM插件时出错

C# 注册Dynamics CRM插件时出错,c#,plugins,dynamics-crm,microsoft-dynamics,C#,Plugins,Dynamics Crm,Microsoft Dynamics,我有一个用C语言构建的插件项目,它包含了我所有的Microsoft Dynamics CRM插件。现有插件工作正常,似乎正在正确更新。然而,当我尝试注册一个新插件时,我得到了以下错误 我尝试注册的事件位于已附加创建和更新事件的实体上。我看到了一些关于无法加载插件类型错误的其他问题,但是没有一个问题表明某个特定的插件无法加载。注册一个新插件,我在这里遗漏了什么 步骤注册设置 现有注册步骤 错误 这似乎在我们的输出文件夹中创建了一个名为merged的新目录,其中包含一个dll版本。我曾尝试使用此版本

我有一个用C语言构建的插件项目,它包含了我所有的Microsoft Dynamics CRM插件。现有插件工作正常,似乎正在正确更新。然而,当我尝试注册一个新插件时,我得到了以下错误

我尝试注册的事件位于已附加创建和更新事件的实体上。我看到了一些关于无法加载插件类型错误的其他问题,但是没有一个问题表明某个特定的插件无法加载。注册一个新插件,我在这里遗漏了什么

步骤注册设置 现有注册步骤 错误 这似乎在我们的输出文件夹中创建了一个名为merged的新目录,其中包含一个dll版本。我曾尝试使用此版本的dll更新程序集,但它以相同的方式出错。我已经尝试过在我们构建的调试版本和发布版本中这样做

我尝试的另一件事是将dll作为引用导入到我的项目中,以尝试查看dll提供的类/函数。dll中似乎没有任何类/函数,但我不确定这是否意味着什么,因为我对dll不太熟悉


当您的插件程序集版本不匹配时,就会发生这种情况。构建最新代码,注册程序集dll,选择所有插件&然后尝试注册新步骤

在事件处理程序值下注册步骤时,我看到插件名称从CCSEQ.Plugins.OpportunityPlugins更改为Opportunity

您还提到了创建和删除的其他步骤,但我看到了创建和更新。你确定你正在更新正确的插件吗


验证类文件的插件项目,这些类文件是程序集下列出的插件,您可以根据这些类文件注册步骤。

我们发现Microsoft.CrmSdk.CoreSassemblies的9.0.2.3版本与我们的插件不兼容。我们还不确定为什么这不起作用,但回滚到8.2.0.2版解决了这个问题。

我尝试了这些步骤并更新了我的答案……仍然不成功
Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Unable to load the plugin type: CCSEQ.Plugins.OpportunityPlugins
Detail: <OrganizationServiceFault xmlns="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <ActivityId>f9958fce-2da6-44ce-855e-532e4e8deeac</ActivityId>
  <ErrorCode>-2147204720</ErrorCode>
  <ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
  <Message>Unable to load the plugin type: CCSEQ.Plugins.OpportunityPlugins</Message>
  <Timestamp>2018-06-06T20:31:33.3462414Z</Timestamp>
  <ExceptionRetriable>false</ExceptionRetriable>
  <ExceptionSource i:nil="true" />
  <InnerFault>
    <ActivityId>f9958fce-2da6-44ce-855e-532e4e8deeac</ActivityId>
    <ErrorCode>-2147204720</ErrorCode>
    <ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
    <Message>Unable to load the plugin type: CCSEQ.Plugins.OpportunityPlugins</Message>
    <Timestamp>2018-06-06T20:31:33.3462414Z</Timestamp>
    <ExceptionRetriable>false</ExceptionRetriable>
    <ExceptionSource i:nil="true" />
    <InnerFault>
      <ActivityId>f9958fce-2da6-44ce-855e-532e4e8deeac</ActivityId>
      <ErrorCode>-2147220970</ErrorCode>
      <ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
      <Message>System.IO.FileLoadException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #0DE0CBC1</Message>
      <Timestamp>2018-06-06T20:31:33.3462414Z</Timestamp>
      <ExceptionRetriable>false</ExceptionRetriable>
      <ExceptionSource i:nil="true" />
      <InnerFault i:nil="true" />
      <OriginalException i:nil="true" />
      <TraceText i:nil="true" />
    </InnerFault>
    <OriginalException i:nil="true" />
    <TraceText i:nil="true" />
  </InnerFault>
  <OriginalException i:nil="true" />
  <TraceText i:nil="true" />
</OrganizationServiceFault>

Server stack trace: 
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at Microsoft.Crm.Tools.Libraries.RegistrationHelper.RegisterStep(CrmOrganization org, CrmPluginStep step)
   at Microsoft.Crm.Tools.PluginRegistration.StepRegistrationViewModel.btnRegister_Click(Object sender, EventArgs e)
Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Unable to load the plugin type: COHEN.Plugins.ActivityPlugins
Detail: <OrganizationServiceFault xmlns="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <ActivityId>1bf82d05-04d0-4bd0-a3db-87c480cc3c6e</ActivityId>
  <ErrorCode>-2147204720</ErrorCode>
  <ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
  <Message>Unable to load the plugin type: COHEN.Plugins.ActivityPlugins</Message>
  <Timestamp>2018-06-07T13:57:24.8030045Z</Timestamp>
  <ExceptionRetriable>false</ExceptionRetriable>
  <ExceptionSource i:nil="true" />
  <InnerFault>
    <ActivityId>1bf82d05-04d0-4bd0-a3db-87c480cc3c6e</ActivityId>
    <ErrorCode>-2147204720</ErrorCode>
    <ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
    <Message>Unable to load the plugin type: COHEN.Plugins.ActivityPlugins</Message>
    <Timestamp>2018-06-07T13:57:24.8030045Z</Timestamp>
    <ExceptionRetriable>false</ExceptionRetriable>
    <ExceptionSource i:nil="true" />
    <InnerFault>
      <ActivityId>1bf82d05-04d0-4bd0-a3db-87c480cc3c6e</ActivityId>
      <ErrorCode>-2147220970</ErrorCode>
      <ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
      <Message>System.IO.FileLoadException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #FB840294</Message>
      <Timestamp>2018-06-07T13:57:24.8030045Z</Timestamp>
      <ExceptionRetriable>false</ExceptionRetriable>
      <ExceptionSource i:nil="true" />
      <InnerFault i:nil="true" />
      <OriginalException i:nil="true" />
      <TraceText i:nil="true" />
    </InnerFault>
    <OriginalException i:nil="true" />
    <TraceText i:nil="true" />
  </InnerFault>
  <OriginalException i:nil="true" />
  <TraceText i:nil="true" />
</OrganizationServiceFault>

Server stack trace: 
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at Microsoft.Crm.Tools.Libraries.RegistrationHelper.RegisterStep(CrmOrganization org, CrmPluginStep step)
   at Microsoft.Crm.Tools.PluginRegistration.StepRegistrationViewModel.btnRegister_Click(Object sender, EventArgs e)
mkdir $(TargetDir)merged $(SolutionDir)packages\ILMerge.2.14.1208\tools\ilmerge.exe /out:$(TargetDir)merged\CCSEQ.Plugins.dll /keyfile:$(ProjectDir)customdevelopment.snk $(TargetDir)CCSEQ.Plugins.dll $(TargetDir)Microsoft.SharePoint.Client.dll $(TargetDir)Microsoft.SharePoint.Client.Runtime.dll