I have a very modest application with a single external assembly (log4net.dll) that I wanted to use ILMerge on. I merge the App.exe and the log4net.dll, and the resulting executable (New.exe) appears to work correctly. However, New.exe is no longer logging and it was logging fine before being merged. Bear I mind I copied App.exe.config over before testing New.exe.
I’m not sure what to make of this. Does anybody have any idea why this would happen? Have I mis-used ILMerge.exe some how? Reflector seems to indicate that New.exe is “whole”; I can see the Log4net assembly and everything.
I do not know the internals of log4net, but I suspect it’s looking for the log4net assembly and can’t find it since you merged it into new.exe. A solution to this is to provide the AssemblyResolve event in the AppDomain with a function that remaps log4net.dll to new.exe.