Creating a single CRM plugin DLL to store in the CRM database
Asked Answered
N

3

3

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.

Ninos answered 20/10, 2010 at 14:41 Comment(0)
F
7

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.

Fiddling answered 20/10, 2010 at 18:46 Comment(1)
As a follow-up, the NuGet ILMerge package makes this even easier. No editing of post-build tasks anymore, it simply merges in everything that's in the build results. Just make sure to mark the CRM SDK DLLs to not be copied to the output folder.Fiddling
E
0

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.

Emie answered 20/10, 2010 at 16:25 Comment(0)
S
-1

Simply drop the DLLs in the folder CRMWeb\Bin

Scarron answered 23/2, 2016 at 8:3 Comment(1)
While possible, this is a terrible solution. Somewhat less so with CRM 4.0 (for which the question was initially created) because extensions could very well use the ISV folder (so deploying files was officially OK) this is really bad for any newer CRM version.Ninos

© 2022 - 2024 — McMap. All rights reserved.