xsharp.eu • How to link in one exe file
Page 1 of 1

How to link in one exe file

Posted: Tue Oct 10, 2017 8:30 pm
by Frank Maraite
Hi all,

some people, Horst for example, like to deliver only one exe file instead of a bunch of dll's.

There is a little program that does this for us: ILMerge. I use it in a little batch file MergeMyProgram.bat that contains:

Code: Select all

del YourApp.LOG
"C:Program Files (x86)MicrosoftILMergeilmerge" /allowdup /out:"D:OutputPathYourApp.exe" "YourApp.exe" "YourAssemblyOne.dll" "YourAssemblyTwo.dll"  /log:YourApp.LOG /targetplatform:v4,C:WINDOWSMicrosoft.NETFrameworkv4.0.30319
These are only two lines! All options must be in one line.

This works not always. For example it does not work if WPF is involved. I don't no why. But for CGI programs (Horst) this could be a possible way to avoid putting all assemblies in the GAC.

If you search for 'ilmerge alternative' you will find additional information, for example this one:

http://www.manuelmeyer.net/2016/01/net- ... ssemblies/
and this
https://github.com/MiloszKrajewski/LibZ

Frank