Program Database Files (C#, F#, and Visual Basic)

This topic applies to:

Edition

Visual Basic

C#

F#

C++

Web Developer

Express

Topic applies Topic applies Topic applies Topic does not apply Topic applies

Pro, Premium, and Ultimate

Topic applies

Topic applies

Topic applies

Topic does not apply

Topic applies

A program database (PDB) file holds debugging and project state information that allows incremental linking of a debug configuration of your program. A PDB file is created when you build with /debug. You can build applications with /debug:full or /debug:pdbonly. Building with /debug:full generates debuggable code. Building with /debug:pdbonly generates PDBs but does not generate the DebuggableAttribute that tells the JIT compiler that debug information is available. Use /debug:pdbonly if you want to generate PDBs for a release build that you do not want to be debuggable. For more information, see /debug (C# Compiler Options) or /debug (Visual Basic).

The Visual Studio debugger uses the path to the PDB in the EXE or DLL file to find the project.pdb file. If the debugger cannot find the PDB file at that location, or if the path is invalid, the debugger searches the path containing the EXE, and then the symbol paths specified in the Options dialog box. This path is generally the Debugging folder in the Symbols node. If the debugger cannot find a .PDB file, a Find Symbols dialog box appears, which allows you to search for symbols or to add additional locations to the search path.

Important

The debugger will load only a PDB for a binary that exactly matches the PDB that was created when the binary was built. That is, the PDB must be the original or a copy. Because the compiler considers a number of factors when it creates a binary, the actual layout of a binary can change even if the code itself has not changed. For more information, see the MSDN blog post Why does Visual Studio require debugger symbol files to *exactly* match the binary files that they were built with?

See Also

Other Resources

Debug Settings and Preparation

Change History

Date

History

Reason

March 2011

Added information and link for exactly matching PDB requirement.

Information enhancement.