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

Announcements

No record found.

News and Announcements icon
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

I have the same question (0)
  • Gopalan Bhuvanesh Profile Picture
    11,401 on at

    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

  • Suggested answer
    prt33k Profile Picture
    6,907 on at

    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

  • Mohd Tahir Profile Picture
    676 on at

    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
    Nausher Sayeed Profile Picture
    522 on at

    Hi Tahir,

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

    It work for me always.

  • Mohd Tahir Profile Picture
    676 on at

    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
    522 on at
  • Suggested answer
    prt33k Profile Picture
    6,907 on at

    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

  • Mohd Tahir Profile Picture
    676 on at

    Hi prt33k,

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

  • Suggested answer
    prt33k Profile Picture
    6,907 on at

    "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"

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

#2
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans