Using ILMerge While Publishing Your Plugin to CRM.

How-To Video:
To watch a video demonstrating how to configure XrmToolkit to use ILMerge, please see the video located here.

ILMerge is a 3rd party tool used to help merge several dll's into a single dll. To learn more about ILMerge please see their website here. Merging your dlls into a single dll is helpful with CRM since you can only upload a single dll file during the registration process. The other option is to register only your main dll in CRM and then place the referenced dlls in the GAC of each server or in the 'bin' folder of each of the CRM servers.

In order to use ILMerge with XrmToolkit you must first download ILMerge from the following website:

Once you have downloaded and installed ILMerge, you must set the 'ILMerge Location' setting in the global settings found here:

Generally, ILMerge.exe will be located in the following directory after installing using the defaults: "C:\Program Files (x86)\Microsoft\ILMerge\ILMerge.exe"

To have XrmToolkit automatically use ILMerge during the 'Build and Publish' process, you need to specify the ILMerge settings while registering the plugin:

You should NOT include any of the CRM SDK assemblies as part of the dlls to merge.

If an assembly that you reference is not listed here, then you need to make sure that the 'Copy Local' property of the assembly has been set to 'True':

Additional ILMerge settings can be found on the other tabs:

Additional Information:
For more information regarding these options, please see the ILMerge documentation found in the same directory of the ILMerge application. This will generally be located here: C:\Program Files (x86)\Microsoft\ILMerge\ILMerge.doc

Once the plugin assembly has been registered in CRM, to update the plugin you can simply press the 'Build and Publish' button on the project menu shown here:

The ILMerge process will occur after the Visual Studio build and the merged DLL will be uploaded to CRM.