部署 MS Dynamics CRM 插件 - 缺少程序集

发布于 2024-10-15 10:29:48 字数 837 浏览 2 评论 0原文

我已按照此链接中的步骤操作,并创建了一个插件: http://msdn.microsoft.com/en-us/library/bb955365。 aspx

我已将其注册到我的实体之一的检索消息上,但是当它触发时,我收到此错误:

Web 服务插件失败于 组织ID: a2dcffbc-e056-4971-adfb-662979139800; SdkMessageProcessingStepId: 5b6921b8-192e-e011-846c-001d0928c4ac; 实体名称:new_csvproiect;阶段:50; 消息名称:检索;组件名称: MSDynCRMPlugin.Plugin, MSDynCRMPlugin, 版本=1.0.0.0,文化=中立, 公钥令牌=a6a43dc7a3dcc61d; 类名:MSDynCRMPlugin.Plugin;

异常:未处理的异常: System.IO.FileNotFoundException:可以 不加载文件或程序集 'System.Web.Services,版本=4.0.0.0, 文化=中立, PublicKeyToken=b03f5f7f11d50a3a' 或 它的依赖项之一。系统 找不到指定的文件。在 MSDynCRMPlugin.Plugin.Execute(IPluginExecutionContext 上下文)在 Microsoft.Crm.Extensibility.PluginStep.Execute(PipelineExecutionContext 上下文)

有什么想法吗?

I have followed the steps from this link, and created a plugin:
http://msdn.microsoft.com/en-us/library/bb955365.aspx

I have registered it on a Retrieve message for one of my entities, but when it triggers I get this error:

Web Service Plug-in failed in
OrganizationId:
a2dcffbc-e056-4971-adfb-662979139800;
SdkMessageProcessingStepId:
5b6921b8-192e-e011-846c-001d0928c4ac;
EntityName: new_csvproiect; Stage: 50;
MessageName: Retrieve; AssemblyName:
MSDynCRMPlugin.Plugin, MSDynCRMPlugin,
Version=1.0.0.0, Culture=neutral,
PublicKeyToken=a6a43dc7a3dcc61d;
ClassName: MSDynCRMPlugin.Plugin;

Exception: Unhandled Exception:
System.IO.FileNotFoundException: Could
not load file or assembly
'System.Web.Services, Version=4.0.0.0,
Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a' or
one of its dependencies. The system
cannot find the file specified. at
MSDynCRMPlugin.Plugin.Execute(IPluginExecutionContext
context) at
Microsoft.Crm.Extensibility.PluginStep.Execute(PipelineExecutionContext
context)

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

吃颗糖壮壮胆 2024-10-22 10:29:48

确保您的插件项目设置为针对 .NET 4 框架,而不是 .NET 4 Client Profile 框架。在 Visual Studio 2010 中,新项目的默认设置似乎是 .NET 4 Client Profile。

我认为对 System.Web.Services 的引用将在 .NET 4 Client Profile 下编译,但在运行它们时实际上将无法执行。

Make sure that your plugin project is set to target the .NET 4 framework, NOT The .NET 4 Client Profile framework. With Visual Studio 2010, the default for new projects appears to be .NET 4 Client Profile.

I think that references to System.Web.Services will compile under .NET 4 Client Profile, but will actually fail to execute when you run them.

一身软味 2024-10-22 10:29:48

您需要将外部程序集合并到您的插件 dll 中。以下是您应遵循的说明: 将 ILMerge 与 CRM 结合使用插件程序集

You'll need to merge outside assemblies into your plugin dll. Here are the instructions you should follow: Using ILMerge with CRM Plugin Assemblies

祁梦 2024-10-22 10:29:48

使用此代码:

AppDomain.CurrentDomain.AssemblyResolve += (sender, args) =>
        {
            String resourceName = "AssemblyLoadingAndReflection." + new AssemblyName(args.Name).Name + ".dll";

            using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName))
            {
                Byte[] assemblyData = new Byte[stream.Length];

                stream.Read(assemblyData, 0, assemblyData.Length);

                return Assembly.Load(assemblyData);
            }
        };

Use this code:

AppDomain.CurrentDomain.AssemblyResolve += (sender, args) =>
        {
            String resourceName = "AssemblyLoadingAndReflection." + new AssemblyName(args.Name).Name + ".dll";

            using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName))
            {
                Byte[] assemblyData = new Byte[stream.Length];

                stream.Read(assemblyData, 0, assemblyData.Length);

                return Assembly.Load(assemblyData);
            }
        };
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文