Tuesday, 15 March 2016

Automating Third Party Assembly Merging in Visual Studio For Dynamics CRM Online Plugin With MSBuild.ILMerge.Task

In Dynamics CRM plug-ins we often require to use third party assemblies. But since we do not have access to server for Dynamics CRM online we cannot register assemblies in GAC which can be referenced from Dynaics CRM plug-in.

To resolve this issue we use the ILMerge for combining the dependent assemblies in our Dynamics CRM plug-in. ILmerge is a command line tool which is capable of merging assemblies together in a single assembly.

This manual task of merging assemblies in a single assembly can be automated by configuring post-build event of Visual Studio but there is even a simpler method for merging.

Install the MSBuild.ILMerge.Task from NuGet Package Manager Console in Visual Studio.

This will  add few files in Visual Studio Project as highlighted below.

On Installation of MSBuild.ILMerge.Task it also downloads ILMerge from NuGet and configures  package.config file so no separate installation is required for ILMerge.

Now you are ready to merge the assemblies, just compile the project and see the merged single assembly in bin folder.

If you needed further control over merged assemblies then you can configure ILMerge.prop



  1. My devs asked to say thank you to you. So here am I saying it. They used some of your hints while working with virtual data rooms . Waiting for some your new posts!

  2. You really did a great job. I found your blog very interesting and very informative. I think your blog is great information source & I like your way of writing and explaining the topics. Keep it up.For more details about oracle fusion financial please check our website.

    Oracle Fusion Financial Training Institute

  3. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a .Net developer learn from Dot Net Training in Chennai. or learn thru ASP.NET Essential Training Online . Nowadays Dot Net has tons of job opportunities on various vertical industry.
    or Javascript Training in Chennai. Nowadays JavaScript has tons of job opportunities on various vertical industry.