Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any way to get VS (2010) to accept PDBs after using ILMerge/Costura to combine assemblies?

This question has pertinence beyond my own case because anyone who has a localized application and has to deliver a standalone EXE has this problem-- they will want to use ILMerge (or Costura or some homebrew solution) to put localization DLLs (or any other assembly) into their EXE-- but once they do that, they can no longer debug their code. The VS debugger will just refuse to accept the original PDB file generated for the original EXE, presumably because the ILMerge step either updates the checksum or changes the GUID.

What I wonder is if there's any way around this.. like some little known ILMerge option, maybe? It strikes me as a very common and unnecessary loss of debugging ability.

I believe the only other way to debug such an app after localization is to maintain a parallel build option that uses the DLLs un-ILMerged, which is fine, unless you happen to want to debug the localization code itself (for example, me).. then you're really out of luck. Can anyone think of other options?

I also tried using Costura, but because localization DLLs all contain resources that are identically named (and are identical to the main resource AppName.resource), you can only add one such DLL to the References: subsequent ones are not allowed. Is there some way to gimmick Costura into working? (if it could be made to work though, the PDB problem might not occur as the combination is part of the the visual studio build..?)

Edit: I'm looking for ideas that result in a PDB/EXE match. I realize you can hack the pdb in a hex editor. The question specifically asks about ways to make the system work as intended, though.

like image 876
user1742196 Avatar asked Nov 13 '22 20:11

user1742196


1 Answers

ILMerge will also generate merged pdb's. Do you have this option switched off, or is the merged pdb also not working for you?

like image 53
Mightymuke Avatar answered Nov 25 '22 09:11

Mightymuke