Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ILMerge exception when trying to merge pdb file

I'm trying to merge two assemblies into a single assembly, which works quiet fine. Yet, when I try to merge the *.pdb files too, I get an error:

Access to the path "F:\Fentec\Businessplan\trunk\Ausgabe\Debug\modules\Planrechnung\Planrechnung.pdb" is denied.

If I use the /ndebug option in order to skip merging the *.pdb files, it works fine. But of course the symbols can't be loaded while debugging. At first I thought when calling ILMerge in the postbuild event, that Planrechung.pdb was in use and locked. I also tried closing VS2010 and call ILMerge from the command line, but the result remained the same. I checked with ProcessExplorer and there is no handle on the file.

This is how I call ILMerge:

E:\XP\Tools\ILMerge\ilmerge /targetplatform:v4,"D:\WINDOWS\Microsoft.NET\Framework\v4.0.30319" /lib:"F:\Fentec\Businessplan\trunk\Ausgabe\Debug\bin" /out:Planrechnung.dll "F:\Fentec\Businessplan\trunk\Ausgabe\Debug\modules\Planrechnung\Planrechnung.dll" "F:\Fentec\Businessplan\trunk\Ausgabe\Debug\modules\Mandantenverwaltung\Mandantenverwaltung.dll"

Have I missed something? If there are any additional infos you need, just ask.

Greetings,
Skalli

like image 427
Skalli Avatar asked Sep 06 '11 10:09

Skalli


1 Answers

I've found the solution to the problem and it's a bit embarrassing.

The output name mustn't be the same name of one of the merged pdb files. Otherwise this problems occurs. When I changed the name of an assembly it worked great. It's also no problem to overwrite a assembly in the process, but you can't overwrite an existing pdb file.
I didn't expect this and stumbled across it by accident. Sorry for all the trouble

Greetings,
Skalli

like image 52
Skalli Avatar answered Sep 21 '22 21:09

Skalli