Reputation: 5478
I'm trying simple merging using ILMerge tool to combine a DLL with the executable. The merging itself works fine, but after I run the merged EXE, it still attempts to find the original DLL (like if it wasn't merged into the EXE at all).
Does ILMerge update references to internal automatically or I have to do something manually? I was under assumption that ILMerge makes everything automatically.
Both EXE and DLL are WinForms .NET 3.5.
Upvotes: 0
Views: 471
Reputation: 5478
The issue was caused by other non-merged DLLs that try to use the original assembly. I had to merge them as well and now everything works correctly.
Upvotes: 1
Reputation: 70369
ILMerge makes several things automatically...
But ILMerge actually modifies the internal structure of both DLL + EXE...
Not all DLLs etc. "like" being "messed with" this way...
For example when EXE and/or DLL use Reflection or WPF merging could make them fail...
In these situations "embedding" (instead of merging) works best... though you will have to write someabout 10 lines of code - see http://blogs.msdn.com/b/microsoft_press/archive/2010/02/03/jeffrey-richter-excerpt-2-from-clr-via-c-third-edition.aspx
IF you just want a tool to make that (and some other things) happen there are some out there - for example SmartAssembly...
Note however: Any of the above works only with .NET DLL - not with native ones...
Upvotes: 1
Reputation: 43278
Is it possible that one of the DLLs in question attempts to re-open itself?
Upvotes: 0