I tried using ILMerge in my WPF based project (VS2010, Net4.0), but I was not able to run the merged executable. So I created two very simple projects
- just a console application that prints hello world
- wpf application that shows a window with the hello world shortcut
After compiling each project, I get one executable file (so merging doesnโt merge anything, itโs just for the test). Of course, every executable works.
Then I merge each executable as follows:
"C:\Program Files\Microsoft\ILMerge\ilmerge" /targetplatform:v4,c:\Windows\Microsoft.NET\Framework\v4.0.30319 /lib:c:\Windows\Microsoft.NET\Framework\v4.0.30319\wpf /out:Merged.exe MyApplication.exe
(I made a multiline read-only SO call). So, now the console application integrates and works as well as before, the wpf application integrates without any errors, but I can not start it. I mean, I type
Merged.exe
The taskbar blinks, but nothing is displayed - there is no window, no error, nothing.
So how do I combine a WPF application?
source share