注册 Dynamics CRM 插件时出错
Error Registering Dynamics CRM Plugin
我有一个用 C# 构建的插件项目,其中包含我用于 Microsoft Dynamics CRM 的所有插件。现有插件工作正常并且似乎正在正确更新。但是,当我尝试注册一个新插件时,出现以下错误。
我要注册的活动是在一个已经附加了 Create
& Update
活动的实体上进行的。我看到了一些关于 Unable to load plugin type
错误的其他问题,但其中 none 似乎表明某个特定的插件无法加载。我在这里注册新插件缺少什么?
步骤注册设置
现有注册步骤
错误
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)
更新 1
根据 Arun 的意见,我更改了我的 C# 项目的名称空间和 dll 构建名称并重新构建了该项目。我这样做是为了不必注销我现有的插件并从头开始重建它们。我使用插件注册工具注册了这个新程序集。当我尝试注册一个新步骤时,我收到与以前相同的错误。所有已注册的插件都会发生这种情况。下面的例子是我尝试过的活动(特别是约会),尽管我也尝试过机会
步骤注册设置
错误信息
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)
更新 2
我注意到我们有一个运行命令的 post-build 步骤:
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
这似乎是在我们的输出文件夹中创建一个名为 merged
的新目录,其中包含一个版本的 dll。我尝试用这个版本的 dll 更新程序集,但它以同样的方式出错。我已经尝试对我们构建的调试和发布版本执行此操作。
我尝试的另一件事是我将 dll 作为参考导入到我的项目中,以尝试查看 dll 提供的 classes/functions。看起来 dll 中没有任何 classes/functions,但我不确定这是否意味着什么,因为我对 dll 不太熟悉。
当您的插件程序集版本不匹配时,就会发生这种情况。构建最新代码,注册 assembly (dll),select 所有 plugins & 然后尝试注册新的 步骤.
当您在 事件处理程序 值下注册步骤时,我看到插件名称从 CCSEQ.Plugins.OpportunityPlugins
更改为 Opportunity
。
您还提到了创建和删除等其他步骤,但我看到了创建和更新。您确定您正在更新正确的插件吗?
验证 class 个文件的插件项目,这些文件是程序集下列出的插件,您可以针对这些文件注册步骤。
我们发现 Microsoft.CrmSdk.CoreAssemblies
的版本 9.0.2.3
与我们的插件不兼容。我们还不确定为什么这不起作用,但回滚到版本 8.2.0.2
解决了这个问题。
我有一个用 C# 构建的插件项目,其中包含我用于 Microsoft Dynamics CRM 的所有插件。现有插件工作正常并且似乎正在正确更新。但是,当我尝试注册一个新插件时,出现以下错误。
我要注册的活动是在一个已经附加了 Create
& Update
活动的实体上进行的。我看到了一些关于 Unable to load plugin type
错误的其他问题,但其中 none 似乎表明某个特定的插件无法加载。我在这里注册新插件缺少什么?
步骤注册设置
现有注册步骤
错误
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)
更新 1
根据 Arun 的意见,我更改了我的 C# 项目的名称空间和 dll 构建名称并重新构建了该项目。我这样做是为了不必注销我现有的插件并从头开始重建它们。我使用插件注册工具注册了这个新程序集。当我尝试注册一个新步骤时,我收到与以前相同的错误。所有已注册的插件都会发生这种情况。下面的例子是我尝试过的活动(特别是约会),尽管我也尝试过机会
步骤注册设置
错误信息
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)
更新 2
我注意到我们有一个运行命令的 post-build 步骤:
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
这似乎是在我们的输出文件夹中创建一个名为 merged
的新目录,其中包含一个版本的 dll。我尝试用这个版本的 dll 更新程序集,但它以同样的方式出错。我已经尝试对我们构建的调试和发布版本执行此操作。
我尝试的另一件事是我将 dll 作为参考导入到我的项目中,以尝试查看 dll 提供的 classes/functions。看起来 dll 中没有任何 classes/functions,但我不确定这是否意味着什么,因为我对 dll 不太熟悉。
当您的插件程序集版本不匹配时,就会发生这种情况。构建最新代码,注册 assembly (dll),select 所有 plugins & 然后尝试注册新的 步骤.
当您在 事件处理程序 值下注册步骤时,我看到插件名称从 CCSEQ.Plugins.OpportunityPlugins
更改为 Opportunity
。
您还提到了创建和删除等其他步骤,但我看到了创建和更新。您确定您正在更新正确的插件吗?
验证 class 个文件的插件项目,这些文件是程序集下列出的插件,您可以针对这些文件注册步骤。
我们发现 Microsoft.CrmSdk.CoreAssemblies
的版本 9.0.2.3
与我们的插件不兼容。我们还不确定为什么这不起作用,但回滚到版本 8.2.0.2
解决了这个问题。