英文:
Debugging a Plugin throws "Could not load type 'Microsoft.Xrm.Sdk.IPluginExecutionContext4' from assembly 'Microsoft.Xrm.Sdk"
问题
我只想通过PluginRegistrationTool调试插件。
我刚刚更新了插件到最新版本。
因此,部署的插件和代码是同步的。当我开始调试(将VS附加到PluginRegistrationTool并开始执行)时,我收到以下错误消息:
未处理的异常:System.TypeLoadException:无法从程序集‘Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’中加载类型‘Microsoft.Xrm.Sdk.IPluginExecutionContext4’。
在PluginProfiler.Plugins.ServiceWrappers.ExecutionContextWrapper.Deserialize(OperationType operation, String serializedValue)
在PluginProfiler.Library.AppDomainProxy.Execute(ProfilerExecutionConfiguration configuration, ProfilerExecutionReport report)
在PluginProfiler.Library.AppDomainProxy.Execute(ProfilerExecutionConfiguration configuration, ProfilerExecutionReport report)
在PluginProfiler.Library.ProfilerExecutionEngine.Execute(ProfilerExecutionConfiguration configuration)
在PluginProfiler.Library.ProfilerExecutionUtility.Execute(PluginPermissions permissions, ProfilerExecutionConfiguration configuration)
在PluginProfiler.Library.ProfilerExecutionUtility.Execute(PluginPermissions permissions, OperationConfiguration operation, ProfilerReportingConfiguration reporting, CrmServiceClient administratorProxy, ITracingService tracing, ILogger pluginILoggerService)
在Microsoft.Crm.Tools.DebugPlugin.DebugPluginViewModel.btnExecutionClicked()
我感到困惑,但是否有人知道为什么引用了IPluginExecutionContext4?!
在项目中IPluginExecutionContext4没有被引用,而且项目可以正常构建。
非常感谢任何帮助!
英文:
I just want to debug a plugin via the PluginRegistrationTool.
I have just updated the plugin with the latest version.
So the deployed plugin and the code are in sync. When I start debugging (Attach VS to PluginRegistrationTool and start execution) I get the following error:
Unhandled Exception: System.TypeLoadException: Could not load type 'Microsoft.Xrm.Sdk.IPluginExecutionContext4' from assembly 'Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
at PluginProfiler.Plugins.ServiceWrappers.ExecutionContextWrapper.Deserialize(OperationType operation, String serializedValue)
at PluginProfiler.Library.AppDomainProxy.Execute(ProfilerExecutionConfiguration configuration, ProfilerExecutionReport report)
at PluginProfiler.Library.AppDomainProxy.Execute(ProfilerExecutionConfiguration configuration, ProfilerExecutionReport report)
at PluginProfiler.Library.ProfilerExecutionEngine.Execute(ProfilerExecutionConfiguration configuration)
at PluginProfiler.Library.ProfilerExecutionUtility.Execute(PluginPermissions permissions, ProfilerExecutionConfiguration configuration)
at PluginProfiler.Library.ProfilerExecutionUtility.Execute(PluginPermissions permissions, OperationConfiguration operation, ProfilerReportingConfiguration reporting, CrmServiceClient administratorProxy, ITracingService tracing, ILogger pluginILoggerService)
at Microsoft.Crm.Tools.DebugPlugin.DebugPluginViewModel.btnExecutionClicked()
I'm confused but does anybody have an idea why it references IPluginExecutionContext4??!
Nowhere in the project IPluginExecutionContext4 is referenced and the project builds without problems.
Any help is highly appreciated!
答案1
得分: 1
我遇到了相同的错误消息(IPluginExecutionContext4 异常),并发现我正在使用几个月前的旧调试插件跟踪消息连接到 Visual Studio。
我进入了插件注册工具(在我这里是 2022 版本),也以管理员身份运行了。我卸载并重新安装了工具栏中的插件分析器,然后生成了一个新的异常插件跟踪(持久保存到 CRM)以用于我的实体记录。之后,我的代码开始正常工作。
链接:https://learn.microsoft.com/en-us/power-apps/developer/data-platform/tutorial-debug-plug-in?tabs=prt
英文:
I had the same error message (IPluginExecutionContext4 exception) and found I was using an older debug Plug-in trace message from several months ago to hook to Visual Studio.
I went into the PlugIn registration tools (a 2022 version in my case) and ran as administrator also. I uninstalled and reinstalled the PlugIn Profiler from the toolbar, then generated a new exception plug in trace (persisted to CRM) for my entity record. After that my code started working.
https://learn.microsoft.com/en-us/power-apps/developer/data-platform/tutorial-debug-plug-in?tabs=prt
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论