Maanas S. Bukkuri
Maanas S. Bukkuri

Reputation: 3

VS 2010 Debugging

Is the .pdb file enough to debug and step into the code of a dll? Or do you actually have to reference the corresponding project source code?

I tried referencing a dll with the .pdb file in the same directory, and was unable to step into the code of the dll. So I was wondering what the rules around dlls and .pdb files where.

Thanks in advance.

Upvotes: 0

Views: 203

Answers (3)

Scott Chamberlain
Scott Chamberlain

Reputation: 127543

The pdb does not contain the source code packaged inside of it (well it can, but it is a bit of a hack and not many people do it), however the symbol server should automatically download it if it has the source available. However the pdb must match the exact version as the dll you are working with for it to download the source.

I have a small suspicion that you are trying to do the .NET framework source stepping and it is not stepping in to it. Microsoft has not updated the symbol servers with the current versions of the pdb files so source stepping is broken if you are running a up to date version of .net (at least until they release the new versions of the source files).

Upvotes: 0

Nathan Taylor
Nathan Taylor

Reputation: 24606

The .pdb file will allow you to debug, but it will not provide any sources. Check out this blog post for an excellent description of PDB files and their purpose.

http://www.wintellect.com/CS/blogs/jrobbins/archive/2009/05/11/pdb-files-what-every-developer-must-know.aspx

Upvotes: 2

w.brian
w.brian

Reputation: 17367

The PDB file is how visual studio knows how the executing code in the assembly corresponds to the lines in the source code. The answer to your question is yes, Visual studio needs the source code that the corresponding pdb was built from.

Upvotes: 1

Related Questions