Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to merge assemblies using ILMerge tool

(0) ShareShare
ReportReport
Posted on by 676

I weren't able to reference an external assembly in one of  my plugin as it's not allowed. Then I tried merging my plugin assembly with the third party dll as suggested by this blog : 

But it says both the dlls need to be signed with dynamics crm password. But how could I sign the external dll.

Do we have any other method to reference external assemblies in plugins for dynamics crm online?

Any help would be highly appreciated, as I need to use many external assemblies to achieve few solutions.

*This post is locked for comments

  • Suggested answer
    prt33k Profile Picture
    prt33k 6,907 on at
    RE: How to merge assemblies using ILMerge tool

    "C:\Program Files (x86)\Microsoft\ILMerge\ILMerge.exe"

    /keyfile:"D:\Plug-ins\MyKey.snk"

    /ndebug

    /copyattrs

    /targetplatform:4.0,"C:\Windows\Microsoft.NET\Framework64\v4.0.30319"

    /out:"D:\Plug-ins\MergedPlugin.dll"

        "D:\Plug-ins\PluginPrimary.dll"

        "D:\Plug-ins\ThirdParty.dll"

  • Mohd Tahir Profile Picture
    Mohd Tahir 676 on at
    RE: How to merge assemblies using ILMerge tool

    Hi prt33k,

    I am unable to run this tool on my Windows system.

  • Suggested answer
    prt33k Profile Picture
    prt33k 6,907 on at
    RE: How to merge assemblies using ILMerge tool

    Hi Tahir,

    So the step should be:

    1) Build you plugin project -this will give you say plugin.dll

    2) You have you 3rd party dll say extra.dll

    3) You create your key using sn.exe -k key.snk (msdn.microsoft.com/.../6f05ezxy(v=vs.110).aspx)

    4) Now in ILMergeUI tool, you add the two assemblies - plugin.dll nad extra.dll. You give the path of your strong key key.snk created in step 3 in highlighted folder structure.

    5) You specify the merged dll name - say MyPlugin.dll and Merge the DLL.

    6) Register the newly generated MyPlugin.dll in PluginRegistration Tool.

    Thanks,

    PS

  • Suggested answer
    Nausher Sayeed Profile Picture
    Nausher Sayeed 522 on at
    RE: How to merge assemblies using ILMerge tool

    Check this

    debajmecrm.com/.../how-to-using-external-un-signed-assemblies-in-plugin-project

  • Mohd Tahir Profile Picture
    Mohd Tahir 676 on at
    RE: How to merge assemblies using ILMerge tool

    Hi Nausher,

    Actually in this post the author creates 2 projects, adds the reference of one project into another project. But I don't see him adding reference of any external project. In my case I want to reference an external dll.

  • Suggested answer
    Nausher Sayeed Profile Picture
    Nausher Sayeed 522 on at
    RE: How to merge assemblies using ILMerge tool

    Hi Tahir,

    Use this link nicknow.net/dynamics-crm-ilmerge-dll-plugin

    It work for me always.

  • Mohd Tahir Profile Picture
    Mohd Tahir 676 on at
    RE: How to merge assemblies using ILMerge tool

    Hi  prt33k,

    I merged the dlls. Then I created a strong key and built the project. Now when I try to upload/deploy this assembly(plugin), I get this error:

    "Invalid assembly public key."

  • Suggested answer
    prt33k Profile Picture
    prt33k 6,907 on at
    RE: How to merge assemblies using ILMerge tool

    Hi Tahir,

    The new DLL that you generate after merging your dll with the 3rd party dll need to be signed - you dont need to sign the 2 dll separately.

    Please use ILMergeUI : https://ilmergegui.codeplex.com/

    Here you can select multiple dll and then the key from which you need to sign the merged assembly.

    5857.2.PNG

    Thanks,

    PS

  • Gopalan Bhuvanesh Profile Picture
    Gopalan Bhuvanesh 11,401 on at
    RE: How to merge assemblies using ILMerge tool

    Hi

    I am not sure about third party dll signing.

    I found few articles about signing dlls (disassemble and add the key and assemble)

    Please check whether this helps:

    http://ryanfarley.com/blog/archive/2010/04/23/sign-a-.net-assembly-with-a-strong-name-without-recompiling.aspx

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,436 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans