创建单个 CRM 插件 DLL 以存储在 CRM 数据库中

发布于 2024-09-28 00:02:00 字数 588 浏览 4 评论 0原文

由于在 MS CRM 中存储插件的建议方法是通过 CRM 数据库,因此我认为是时候对我当前使用的方法(将 DLL 存储在磁盘上)做一些事情了。

然而,问题是我不知道如何嵌入 DLL 所需的所有其他各种位:本地化资源文件(保存在另一个文件夹中)和最新 SDK 中的一些引用的 DLL(必须是手动放置在 bin\ assembly 文件夹中)。在这一点上,我什至不完全确定这是可能的。

到目前为止,我尝试通过将资源文件上的构建操作更改为“内容”或“资源”来解决本地化问题,并测试了此解决方案(仍将位置保留在磁盘上,但没有添加本地化文件夹)。这不起作用:当我故意在其中一个插件中生成验证错误时,尽管在 CRM 中选择了不同的语言,但我还是收到了默认语言消息(英语)。

在尝试添加一些引用的 DLL 文件(即新的 SDK DLL:xrm.portal、xrm.portal.files 和 xrm.client)时,我遇到了类似的问题。当我尝试将插件存储在数据库中(暂时跳过本地化问题)时,我收到一条 CRM 错误,指出它找不到 XRM.Client 程序集或其依赖项之一。我知道我可以使用 ILMerge 将整个事情整合在一起,但我的直觉告诉我这并不是一个好主意。

关于这个问题的任何提示或建议都会很棒。

Since the suggested way of storing plugins in MS CRM is via the CRM database, I figured it's about time to do something about the method I'm currently using, which is storing the DLLs on the disk.

The trouble however is that I don't know how to embed all the other various bits that are needed by the DLL: the localization resource files (which are kept in another folder) and some referenced DLLs from the latest SDK (which had to be manually placed in the bin\assembly folder). At this point, I'm not even entirely sure this is possible.

So far I've tried to solve the localization problem by changing the build action on the resource files to "Content" or "Resource" and tested this solution (still keeping the location on-disk, but without the added localization folder). This didn't work: when I purposely generated a validation error in one of the plugins, I got the default language message (English) despite having a different language selected in the CRM.

I've faced a similar problem when trying to add some of the referenced DLL files (namely the new SDK DLLs: xrm.portal, xrm.portal.files and xrm.client). When I tried to store the plugin in the database (skipping for a moment the localization issue), I got a CRM error saying it cannot find the XRM.Client assembly or one of it's dependencies. I know I could use ILMerge to put the whole thing together, but I've got a gut feeling telling me this isn't really a good idea.

Any hints or suggestions on this issue would be great.

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

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

发布评论

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

评论(3

指尖上的星空 2024-10-05 00:02:00

我们总是 ILMerge 我们的插件,并且没有遇到任何问题。我们不会合并 SDK dll,因为它们已经在目标服务器上进行了 GAC 处理。

不过,我们并没有真正在插件 dll 中进行本地化,所以我认为您可能需要做的是,如果您当前的资源管理器是基于文件的,则使其基于程序集,然后从中加载必要的资源。

We always ILMerge our plugins and have had no issues with that. We don't merge in the SDK dlls, because those will already be GACed on the target server.

We don't really do localization inside our plugin dlls, though, so I think what you may have to do is, if your current resource manager is file based, to make it assembly based and just load up the necessary resources from that.

只涨不跌 2024-10-05 00:02:00

我有一组助手,它们捆绑在我的大多数实现中使用的外部程序集中。我会将其部署到 bin 文件夹并保留在那里。我自己从未尝试过 ILMerge,但这似乎是一个有趣的概念。

I have a set of helpers that are bundled in an external assembly that I use for most of my implementations. I will deploy this to the bin folder and leave it at that. I've never tried ILMerge myself, but it seems like an interesting concept.

蓝眸 2024-10-05 00:02:00

只需将 DLL 放入文件夹 CRMWeb\Bin 中即可

Simply drop the DLLs in the folder CRMWeb\Bin

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