尝试使用插件注册工具调试插件中的错误时,无法将“xxxx”类型的对象转换为“Microsoft.Crm.Sdk.IPlugin”类型
我们在内部使用 CRM
这里是完整的错误:
Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Unable to cast object of type 'PluginCreatedBy.PluginCreatedByClass' to type 'Microsoft.Xrm.Sdk.IPlugin'.
Detail: <OrganizationServiceFault xmlns="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<ErrorCode>-2147220970</ErrorCode>
<ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
<KeyValuePairOfstringanyType>
<a:key>CallStack</a:key>
<a:value i:type="b:string" xmlns:b="http://www.w3.org/2001/XMLSchema"> at PluginProfiler.Library.PluginAppDomainProxy.ExecuteCore(Stopwatch watch, ProfilerExecutionReport report, Object instance, Object executionParameter)
at PluginProfiler.Library.AppDomainProxy.Execute(ProfilerExecutionConfiguration configuration, ProfilerExecutionReport report)</a:value>
</KeyValuePairOfstringanyType>
</ErrorDetails>
<Message>Unable to cast object of type 'PluginCreatedBy.PluginCreatedByClass' to type 'Microsoft.Xrm.Sdk.IPlugin'.</Message>
<Timestamp>2021-07-19T05:18:55.850152Z</Timestamp>
<InnerFault i:nil="true" />
<TraceText i:nil="true" />
</OrganizationServiceFault>
已经尝试在 web.config 的运行时标签中添加版本行