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)

when to use early binding and late binding in plugin.

(0) ShareShare
ReportReport
Posted on by 2,654

Hi,

please tell me whether to use early or late binding in code. and where to use early and late binding. what are the advantages and disadvantages of both.

*This post is locked for comments

I have the same question (0)
  • Royal King Profile Picture
    27,686 on at

    It depends on which one you are compatible with. there is really not much difference in using early or late binding apart from the file size. Early binding file size will be large compare to late binding one.

    check the below post from Scott that provides detailed information about late and early binding difference

    community.dynamics.com/.../early-binding-vs-late-binding-performance-revisited.aspx

  • Suggested answer
    Hosk Profile Picture
    on at

    For most plugins I would use Early binding.  The performance difference is minimal, unless you are updating lots of records.

    The benefits of early binding are

    Better readability of code

    not syntax errors because the code uses fields that exist and the programmer doesn't have to type them in.

    it removes type/casting errors because the compiler knows what type each field is, where as late binding the compiler doesn't know until the code is running.

    The benefit of removing the errors mentioned above is it means bugs are moved to compile time rather than run time

    you can read about performance here

    www.develop1.net/.../Early-Binding-vs-Late-Binding-Performance-Revisited.aspx

    Early bound classes produce code which is easier to understand (readability) and easier to debug, maintain and extend.

    Late bound is ok if you want to write a generic plugin which isn't bound by one particularly entity

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