ILMerge exception while trying to merge pdb file

I am trying to combine two assemblies into one assembly, which works quietly. However, when I try to merge * .pdb files, I get an error message:

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

If I use the / ndebug option to skip merging * .pdb files, it works fine. But of course, characters cannot be loaded during debugging. At first I thought that when calling ILMerge in the postbuild event, this Planrechung.pdb is used and blocked. I also tried closing VS2010 and calling ILMerge from the command line, but the result remained the same. I checked with ProcessExplorer and there is no handle in 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"

Did I miss something? If you need more information, just ask.

Hi,
Skalli

+8
c # visual-studio-2010 ilmerge
source share
2 answers

I found a solution to the problem, and this is a bit confusing.

The output name must not match the name of one of the combined pdb files. Otherwise, problems arise. When I changed the assembly name, it did a great job. There is also no problem rewriting the assembly in the process, but you cannot overwrite the existing pdb file.
I did not expect this and accidentally stumbled upon it. Sorry for all the problems.

Hi,
Skalli

+19
source share

It seems to me that the .pdb file is locked, possibly because it is used in a debugger (for example, Visual Studio).

Try closing both Visual Studio and your application (if you haven't already).

If this does not work, use a tool such as Process Explorer to find the processes that open this file. In the process explorer, you can do this using Find → Find Handle or Dll ...:

Screenshot of the Process Explorer Search dialog

Enter the name of the file / pdb that you are looking for and it will display all the processes that open this file - either close the individual descriptors or uninstall / close these applications and try again.

0
source share

All Articles