For various reasons we use ilmerge to put all of our application assemblies into one file so the user needs to handle just one file. Unfortunately it seems that there is no way to merge the .pdb files with the assemblies. Anyone knows a way to work around that?
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=""..\..\Libraries\Ilmerge.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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With