0

I am compiling a DLL project with the additional option /PDBALTPATH:%_PDB% which should only emit the file name for the pdb file without path information. Looking at the DLL with a hex editor only "MyDLL.pdb" is emitted.

In code I copy the DLL and pdb from MyProject/Debug/MyDLL.pdb to MyProject/Debug/Temp/MyDLL.pdb and use LoadLibrary to load it. The problem is the debugger uses the MyProject/Debug/MyDLL.pdb file instead of the one in the Temp dir. If I delete the pdb file in the Debug dir the debugger uses the one in the Temp dir which is what I want.

What can I do to get the desired behavior without deleting the pdb in /Debug/ which causes the linker to do a full link every build.

prydain
  • 365
  • 3
  • 11
  • Why don't you just fix the real problem and change the project's OutputDirectory setting so it gets built to the directory you want? No more copying, no need for /pdbaltpath, no need to try to tell the debugger about it. – Hans Passant Feb 04 '15 at 18:33
  • That's not the real problem. The DLL gets recompiled at runtime with msbuild which overrides the one in $(OuputDir) which is only possible if the running porgramm has a copy loaded. – prydain Feb 04 '15 at 19:09
  • Is 'MyProject/Debug' the working directory for debugger? The debugger may start to resolve symbols from its working directory. – Thomson Apr 21 '15 at 07:50

0 Answers0