18

I try to debug a program in Visual Studio 10, but I have a problem with breakpoints. I put *.pdb files corresponding to the *.dll files to the same directory. But while checking modules, I see that each DLL file is signed as Cannot find or open the PDB file.

How can I fix this problem? How can I check where *.pdb files are expected to be located?

Matt Johnson-Pint
  • 230,703
  • 74
  • 448
  • 575
YAKOVM
  • 9,805
  • 31
  • 116
  • 217

5 Answers5

14

The modules (Ctrl-D, M) is a good place to sort out whats going on so you're in the right area.

Right-click the module/dll you expected the pdb to be found for and select Symbol Load Information

It should look in the same directory as your dll to begin with and if it finds the pdb will either load it or tell you that the pdb file doesnt match the dll.

wal
  • 17,409
  • 8
  • 74
  • 109
13

Go to Debug -> Options and Settings -> Debugging -> Symbols, check Microsoft Symbol Servers under Symbol Locations. See attached photo.

Include Symbols

john k
  • 6,268
  • 4
  • 55
  • 59
  • Ok, but where did the local version of the symbols go? Is there anyway to recreate them as it was before becoming unavailable? – Redoman Mar 08 '16 at 03:58
6

I had a similar problem in VS2013 ... something to do with a PDB file and IISEXPRESS. I tried several things and eventually resolved it by doing this:

Tools > Options > Debugging > Symbols and then pressing the "Empty Symbol Cache" button

Upon rerunning my app, it took awhile for Visual Studio to reload all of the symbols but it did eventually do so and the problem was fixed!

Robert W.
  • 61
  • 1
  • 1
2

In my case, I was debugging a click-once windows app. In the module's Symbol Load Information, it told me the pdb was out of sync with the currently attached image. I had to review the whole list not just the top or bottom item, to get that error text.

That told me to recompile and re-publish what I was attaching to, so the two would match. That caused the module list to say Symbols loaded for my assembly that I was debugging, and to go on and continue debugging the issue.

toddmo
  • 20,682
  • 14
  • 97
  • 107
  • For me, it wasn't a click-once app, but the end result was the same in that the .dll was out of date. I was using `AssemblyLoadContext.LoadFromAssemblyName`. I had thought the program would load the .dll from the project's bin folder, but I was wrong. Instead, it was first searching a different folder where an outdated version of the .dll was hiding (unbeknownst to me). That was making it so that the .pdb didn't match and so it wouldn't load, even when I was manually trying to point it there. – David Aug 23 '21 at 22:12
0

Change Project Directory like if you run/debug code in Windows system directory it wont execute with admin permission,

in my case i save my project in C: drive and while i execute code i throw access violation to read input data error then i try it from different location and it work fine

& also you have to load module as well