Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ILMerge Best Practices

Do you use ILMerge? Do you use ILMerge to merge multiple assemblies to ease deployment of dll's? Have you found problems with deployment/versioning in production after ILMerging assemblies together?

I'm looking for some advice in regards to using ILMerge to reduce deployment friction, if that is even possible.

like image 876
James Pogran Avatar asked Aug 13 '08 01:08

James Pogran


People also ask

What is ILRepack?

ILRepack is a tool that allows you to merge multiple assemblies into a single assembly. This can be useful when you deploy an application that has a few dependencies. In this case, you can merge all the dll and the exe into a single exe file, so it's easier to deploy it. It's also useful if you create a NuGet package.


1 Answers

I use ILMerge for almost all of my different applications. I have it integrated right into the release build process so what I end up with is one exe per application with no extra dll's.

You can't ILMerge any C++ assemblies that have native code. You also can't ILMerge any assemblies that contain XAML for WPF (at least I haven't had any success with that). It complains at runtime that the resources cannot be located.

I did write a wrapper executable for ILMerge where I pass in the startup exe name for the project I want to merge, and an output exe name, and then it reflects the dependent assemblies and calls ILMerge with the appropriate command line parameters. It is much easier now when I add new assemblies to the project, I don't have to remember to update the build script.

like image 101
Lamar Avatar answered Sep 20 '22 18:09

Lamar