c# - 注册 Dynamics CRM 插件时出错
问题描述
我有一个用 C# 构建的插件项目,其中包含我所有的 Microsoft Dynamics CRM 插件。现有插件工作正常,并且似乎正在正确更新。但是,当我尝试注册新插件时,出现以下错误。
我尝试注册的事件位于已附加Create
&Update
事件的实体上。我已经看到有关该Unable to load plugin type
错误的其他一些问题,但似乎都没有表明无法加载的特定插件。我在这里注册新插件时缺少什么?
步骤注册设置
现有注册步骤
错误
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
我注意到我们有一个运行命令的后期构建步骤:
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 提供的类/函数。dll中似乎没有任何类/函数,但我不确定这是否意味着什么,因为我对dll不太熟悉。
解决方案
我们发现该版本与我们9.0.2.3
的Microsoft.CrmSdk.CoreAssemblies
插件不兼容。我们还不确定为什么这不起作用,但回滚到版本8.2.0.2
解决了这个问题。
推荐阅读
- c# - 使用位图将转换后的 HTML 的自动宽度和高度设置为图像
- autodesk-forge - Autodesk Forge 第三方更新程序对话框问题
- javascript - 遍历嵌套在对象内部的数组
- c# - 使用 Linq + MongoDb Driver 查询 UUID Key
- javascript - setTimeOut(function,time) 是否不断在函数堆栈上创建负载?
- database - 将 DocumentDB 复制到本地 mongo 服务
- r - 将 class(x) 设置为“environment”将属性设置为 NULL;结果将不再是 S4 对象
- python - 如何使用带有多个源列的 pandas_udf 将多个列添加到 pyspark DF?
- javascript - Javascript:“对象属性”实例的空构造函数名称
- python - 如何根据布尔条件更改熊猫数据框中的单元格