Ok, I figured this one out, though it took a while.
That article has /ndebug exactly backwards.
From the release notes that come with ILMerge (ILMerge.doc, emphasis mine):
2.8 DebugInfo public bool DebugInfo { get; set; }
When this is set to true,
ILMerge creates a .pdb file for the
output assembly and merges into it any
.pdb files found for input assemblies.
If you do not want a .pdb file created
for the output assembly, either set
this property to false or else specify
the /ndebug option at the command
line. Default: true Command line
option: /ndebug
The solution is specifically to not have that flag on your command line. ILMerge will merge pdb files by default. Make sure that all of the pdb files of your source assemblies are in the same directory, along side their associated dlls, so that ILMerge can find them. (We are using project references and have one ILMerge project, which takes care of this requirement.)
Here is the relevant section from my ILMerge csproj file.
<Target Name="AfterBuild">
<CreateItem Include="@(ReferencePath)" Condition="'%(CopyLocal)'=='true'">
<Output TaskParameter="Include" ItemName="IlmergeAssemblies" />
</CreateItem>
<Exec Command=""....LibrariesIlmerge.exe" /copyattrs /allowMultiple /out:"@(MainAssembly)" "@(IntermediateAssembly)" @(IlmergeAssemblies->'"%(FullPath)"', ' ')" />
<Delete Files="@(ReferenceCopyLocalPaths->'$(OutDir)%(DestinationSubDirectory)%(Filename)%(Extension)')" />
</Target>
For completeness, I am using the latest version of ilmerge.exe: Version 2.10.219.0, with a last modified date of 2/19/2010 9:49 AM
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…