6

I am using Visual Studio 2010, recently upgraded. The solution contains 25 projects, makes a dozen dll's and exe's. I am trying to debug a particular problem and I can't due to symbols not being loaded.

I get the "Cannot find or open the PDB file", this is for a PDB file one of the DLL's the project generates, all the other PDB files load just fine. The PDB file exists in the same directory as the dll, I have also cleaned and rebuilt the solution.

In addition I have ran process explorer filtering on the pdb name, this indicated that it was found, opened and read successfully. Oddly it also continued to look in other locations for the pdb as well.

Anyone have any thoughts on this?

Matt Johnson-Pint
  • 230,703
  • 74
  • 448
  • 575
Vireche
  • 63
  • 1
  • 4
  • Found a fix for this, but really have no idea why it works. Changed the name of the pdb file that the project creates. What is odd, is that it still created the pdb file with the old name, and did not create the file with the new name. But it did manage to find the pdb file and load it. – Vireche Sep 27 '11 at 21:23
  • When you find a fix, instead of posting it as a comment, post it as an answer and selected it as the accepted answer. – Nav Oct 11 '11 at 09:17

3 Answers3

2

In most cases Visual Studio has problems with the file handles. Visual Studio sees the PDB as being used by a process, but that process is Visual Studio (I know, kinda stupid).

Try rebooting the machine and manually deleting the PDB file before build. That usually works for me.

Cosmin
  • 21,216
  • 5
  • 45
  • 60
0

Turn on Microsoft Symbols Server in Debug -> Options and Settings -> Debugging -> Symbols

enter image description here

john k
  • 6,268
  • 4
  • 55
  • 59
0

Are you getting multiple projects or builds outputting the same PDB file? I had a project that I could compile as a EXE or a DLL. Of course, by default, they over wrote each others PDB file. So VS would detect that the PDB doesnt match.

When I moved to VS2010, I solved this issue by setting Target Name to "$(ProjectName)_$(Configuration)" for ALL projects and configurations.

Bonts
  • 609
  • 9
  • 9