web
You’re offline. This is a read only version of the page.
close
Skip to main content
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)
  • Suggested answer
    prt33k Profile Picture
    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
    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
    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
    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
    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
    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
    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
    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
    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

Responsible AI policies

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

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
Aric Levin - MVP Profile Picture

Aric Levin - MVP 2 Moderator

#3
ED-30091530-0 Profile Picture

ED-30091530-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans