Bringing our best ideas and thinking to you.
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.
August 24, 2016
Social Workplace Perks at A Hundred Answers
A Hundred Answers provides numerous social work perks for its employees.
August 24, 2016
Improving Data Driven Website Performance
Data driven websites are at the core of enabling a rich user experience. Can you significantly improve your website’s performance?