5

Using Visual Studio 2010 to remote debug a C# .dll -- getting .PDB file does not match - any yet it is absolutely the from the build...............

New info: [[ This problem is not resolved. I have three computers: a)XP sp3, b)XP sp3 and c)Vista sp1, I can build the simplest of test programs on a) and c), and using the module window -- select my test5.exe and load the .pdb that was created when it was created - same date same time same folder... and yet Visual Studio says "a matching symbol file was not found in this folder" -- all efforts to load the correct .pdb fail with not matching complaint.... be it: a) remote to b) or c) -or- c) remote to a) or b) --- HELP! ]]

I have set the location of the .PDB implicitly and explicitly - does not matter....

I have set the symbol settings to be unchecking that source files must match exactly....

I am seeing no Errs....

Just:


C:\POSWIN\DBS.KGW.tst7.pdb: Cannot find or open the PDB file.
C:\Projects\SP\DBS.KGW.tst7STUB\DBS.KGW.tst7\obj\Debug\DBS.KGW.tst7.pdb: PDB does not match image.
C:\Projects\SP\DBS.KGW.tst7STUB\DBS.KGW.tst7\bin\Debug\symbols\DLL\DBS.KGW.tst7.pdb: Cannot find or open the PDB file.
C:\Projects\SP\DBS.KGW.tst7STUB\DBS.KGW.tst7\bin\Debug\DLL\DBS.KGW.tst7.pdb: Cannot find or open the PDB file.
C:\Projects\SP\DBS.KGW.tst7STUB\DBS.KGW.tst7\bin\Debug\DBS.KGW.tst7.pdb: PDB does not match image.
C:\Projects\SP\DBS.KGW.tst7STUB\DBS.KGW.tst7\bin\Debug\MicrosoftPublicSymbols\symbols\DLL\DBS.KGW.tst7.pdb: Cannot find or open the PDB file.
C:\Projects\SP\DBS.KGW.tst7STUB\DBS.KGW.tst7\bin\Debug\MicrosoftPublicSymbols\DLL\DBS.KGW.tst7.pdb: Cannot find or open the PDB file.
C:\Projects\SP\DBS.KGW.tst7STUB\DBS.KGW.tst7\bin\Debug\MicrosoftPublicSymbols\DBS.KGW.tst7.pdb: Cannot find or open the PDB file.
C:\WINDOWS\symbols\DLL\DBS.KGW.tst7.pdb: Cannot find or open the PDB file.
C:\WINDOWS\DLL\DBS.KGW.tst7.pdb: Cannot find or open the PDB file.
C:\WINDOWS\DBS.KGW.tst7.pdb: Cannot find or open the PDB file.

Matt Johnson-Pint
  • 230,703
  • 74
  • 448
  • 575
kevinwaite
  • 613
  • 1
  • 8
  • 20
  • 1
    what kind of app is it? web? winforms? – Robbie Apr 18 '12 at 18:25
  • Do you running any aspnet_merge or signing tool after build ? Are you sure that pdb's in bin\obj exactly from same build ? did you try to put pdbs on remote server - remote debugging service (msvcmon) could ship pdbs to your pc from remote server. Or try to load it explicitly on first break\debug pause. – Alexey Shcherbak Apr 18 '12 at 18:27
  • Where are your DLL's located and where are the PDB's? What kind of app are you doing, WPF/IIS? – Matthew Bonig Apr 18 '12 at 18:31
  • I could not get this worked for the life of me. I finally got it working by taking the DLL and PDB from my dev machine and overwriting the remote computers dll and pdb. Now the symbols get loaded and I can debug. I tried building my app in release mode and copying the release pdb to the remote system, but that still didn't work. – The Muffin Man Mar 27 '15 at 18:22

3 Answers3

5

A couple of suggestions:

  • In visual studio, while you are attached to the process, open the modules debug window, Ctrl+D, M (or Debug -> Windows -> Modules from the menu) and find the dll that's causing issues. Right click it and select Load Symbols From and then Symbol Path locate the correct pdb file and see if it loads.
  • If you're app is asp.net, then you could try clearing the temp folder as it sometimes causes problems similar to yours. That folder should be located somewhere like this:

    bootdrive:\%windir%\Microsoft.NET\Framework\v2.0.5 0727\Temporary ASP.NET

Depending on your .net version.

Robbie
  • 18,750
  • 4
  • 41
  • 45
  • This problem is not resolved. I have three computers: a)XP sp3, b)XP sp3 and c)Vista sp1, I can build the simplest of test programs, and using the module window -- select my test5.exe and load the .pdb that was created when it was created - same date same time same folder... and yet Visual Studio says "a matching symbol file was not found in this folder" -- all efforts to load the correct .pdb fail with not matching complaint.... be it: a) remote to b) or c) -or- c) remote to a) or b) --- HELP! – kevinwaite Apr 19 '12 at 14:08
  • Robbie, you are the man! You have made me a better developer because now I am aware of the Modules windows and know how to use it to properly load my symbols. I have multiple branches of code and I guess it was pointing at some weird path for it. Thanks! – Jpepper Jan 20 '15 at 07:20
1

The solution is that for remote debug connections there are two ways to connect, authorized and unauthorized... For firewall issues, I defaulted to unauthorized. For VS 2010 C# solutions the complaint is merely the .PDB does not match. Having exhausted all options I could think of I went and reproduced my simple test solution in C++, the interface is different and better and there is a warning as you set this up that you will not get symbols unless you are on an authorized connection!!! -- Once I overcome the firewall issue -- and see my symbols via an authorized connection to the remote PC that is being debugged, I will post that confirmation...... btw, often it is warned that when you sign-on via an authorized connection the user ID and password for both the host and debugged computer must be the same, furthermore the user on the debugged computer must have "logon as service" right added to its user.....

kevinwaite
  • 613
  • 1
  • 8
  • 20
  • +1: almost unbelievable, but I have no point in not believing you. Thanks for the explanation and solution. I do not know if it is possible on SO, but try to mark your own answer with 'tick' as the accepted one, so others will know that 'the case is closed' for you. – quetzalcoatl Aug 23 '12 at 14:11
1

I have got same problem and solution was so easy...

In my case, I have two VS solutions, first is main app with .exe and second .dll plugin project. When I tried to debug a dll project, I get a pdb not matching error (in module window). The reason was that pdb was actually not matching at all because:

When I was testing first solution, I copy .dll file from second solution to debug folder with .exe file.
Then when I tried to debug second (.dll) solution, it was using .exe file from first solution AND ALSO THE .dll file in that directory, but that .dll was outdated and didnt match with new pdb file. So copying a new .dll file from second project to .exe directory resolved my problem.

icl7126
  • 5,740
  • 4
  • 53
  • 51
  • The original problem was already solved, but thanks for an additional case! Mistaking files and paths is a common cause for that error. – quetzalcoatl Aug 23 '12 at 14:13