Program Database Files (C#, F#, and Visual Basic)
Updated: March 2011
This topic applies to:
Pro, Premium, and Ultimate
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.
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?