fbpx
× Share your code snippets, screen shots etc. here

How to link in one exe file

More
1 year 3 months ago - 1 year 3 months ago #1 by Frank Maraite
How to link in one exe file was created 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:
del YourApp.LOG
"C:\Program Files (x86)\Microsoft\ILMerge\ilmerge" /allowdup /out:"D:\OutputPath\YourApp.exe" "YourApp.exe" "YourAssemblyOne.dll" "YourAssemblyTwo.dll"  /log:YourApp.LOG /targetplatform:v4,C:\WINDOWS\Microsoft.NET\Framework\v4.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:

www.manuelmeyer.net/2016/01/net-power-ti...-merging-assemblies/
and this
github.com/MiloszKrajewski/LibZ

Frank
Last edit: 1 year 3 months ago by Frank Maraite. Reason: typo

Please Log in or Create an account to join the conversation.