Does ilmerge optimize the output?

2020-07-30 04:08发布

问题:

I have a number of DLLs that are merged using the ILMERGE.EXE tool from Microsoft. All the DLLs have 'optimize my code' unchecked.

When trying to debug code in a web application the modules screen (in Visual Studio) shows the dll has been optimized. This obviously causes a problem when trying to debug certain parts of the application.

Is there a way of building a DLL using ILMERGE which does not optimize the code?

回答1:

ILMerge has an option to merge PDBs if you use it, you will be able to debug through your code.

See this blog post and discussion on Scott Hanselman's blog

Also see ILMerge Gui for a UI that has this integrated



回答2:

Add the /copyattrs-Attribute to the ILMERGE command line.