Bringing our best ideas and thinking to you.
November 11, 2016
Share this page:
Using ILMerge to Include Referenced Packages in Microsoft Dynamics CRM Plugins
By Shawn Lautebach
When writing Plugins for CRM, it is handy to include and use libraries from the NuGet repository, or your own shared library project. But with CRM a plugin is self contained within its assembly and to reference any other assemblies you will need to upload the additional assemblies to all the CRM server GAC (Global Assembly Cache). This can be a nightmare to manage or may not even be technically possible.
A solution to this is to use ILMerge a utility for merging multiple .Net assemblies into on single .Net Assembly. You can download the tool from Microsoft here: https://www.microsoft.com/en-us/download/details.aspx?id=17630. Or you can add a NuGet package to your project 'MsBuild ILMerge task' (https://www.nuget.org/packages/MSBuild.ILMerge.Task/).
To ensure that the CRM SDK assembly references are not merged, right click on each assembly reference and click properties. Change the property: 'Copy Local' to 'false'. This will ensure that these assemblies are not merged into your plugin assembly.
Read all of our news, white papers, and case studies.
October 4, 2018
National Accounting Firm and Leading Tech Company Join Forces
AHA Merger with MNP Brings Enhanced Technology Solutions to Clients
October 4, 2018
Managing Web Forms in a Web Content Management System
Web forms can be managed and maintained through a WCMS system to save company time.