web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Dynamics 365 Plugin/Custom WF structure

(0) ShareShare
ReportReport
Posted on by 607

On previous projects, I am used to setup plugins as one project, resulting in one plugin assembly. Each class created was an event, e.g. AccountPreValidate, AccountPreCreate,... External libraries were included via ILMerge.

As a PoC, I started to divide plugins per functionality, in a class per functionality: e.g. Account.SetDefaultBusiness or Account.CreateMasterdataTask. This seems to lead to much cleaner steps, with matching filtering attributes and allows to disable functionality when needed (e.g. during data migration). However it leads to other questions:

  • Can you better create one big plugin assembly or an assembly per entity for example?
    I have seen projects having an assembly per triggering entity, e.g. AccountPlugin and ContactPlugin assemblies. In large projects, this leads to up to 50+ projects. How does it affect performance, maintainablility, caching? What are the pro's and cons of both?

  • We are setting up plugins in such way that they contain a few lines of code, and then call a function/method in a separate library, containing all business logic. However the customer's shared library should contain some of our common logic used on every customer project, which we were planning to distribute via nuget.

    Since the use of ILMerge is unsupported/discouraged (community.dynamics.com/.../if-you-re-using-ilmerge-with-your-plugins-make-sure-you-read-this), how can we share code over multiple projects? I was thinking on Shared projects in VS, but those do not allow nuget to include our vendor specific code. Are there other solutions?

  • When using a shared project for the library, we could add our early bound classes there? Would you include all generated early bound classes in each plugin project (if working with multiple projects)?

Kind regards

Kim

*This post is locked for comments

I have the same question (0)
  • Radu Chiribelea Profile Picture
    6,667 on at

    Hi Kim,

    Maybe this blog article can give you some ideas on how to handle situations where you need to merge assemblies: develop1.net/.../ILMergeNotSupported

    Hope this helps,

    Radu

  • DlwK Profile Picture
    607 on at

    Hi Radu, thanks for your response. This article, amongst others, was leading me to those questions. I was thinking on using a shared project in VS to share the business logic library to the plugin and workflow project(s). However, there is no nuget possible to apply our base logic (plugin base class, etc). If this customer library is no longer a real project, it is harder to test it separately?

  • PranavShroti Profile Picture
    4,510 on at

    Hi Kim,

    I always use Developer Toolkit provided by Microsoft to manage my solutions in Visual Studios. It gives control and you can manage webresources as well.

    As far a plugin, if project is big and you are having to write multiple plugins, I manage it module-wise. So for sales I keep all sales entities related plugins/WF in a single assembly.

    Well on a lighter note if you start writing huge amount of plugings, then perhaps you are on a wrong track, Dynamics is better off with limited customization.

    Regards,

    Pranav

  • DlwK Profile Picture
    607 on at

    Thanks for the answers. I have read that a lot of plugin classes would be a bad idea because of the overhead regarding to caching on the server? Does anyone have more details about this?

    Also, as proposed in the article of Scott Durow, ILMerge should better not be used.

    We are thinking on using a shared project in Visual Studio. However, on that library project, we wanted to use nuget to import our base plugin classes/extensions. What would be a good way to achieve this for a shared project, since nuget is not possible there?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans