Debugging with Pdb file and Source Code File in Visual Studio

I have a web project that posts from client-side code to a method in external dll, which I have source code file and pdb file of this external dll. What I would like to do is to debug external dll using source code file and pdb. Visual studio does not stop to say no symbols are loaded for the module since.


To debug an dll a symbol file with the same version is allways needed. When you are debugging your own applications you usually don't have to care about this.

But there are things happening in the background. Visual stuido allways puts the symbol files in the debug folder when you build your application and also loads them as described under Loading the symbols automatic .

(When you distribute your application you usually do not want to distribute those symbols and therefore they won't be copied to the release directory you change your build configuration to release.)

Loading the symbols manuell

If you want to load the symbols manually you can load them with the Modules dialog.

"Debug" -> "Windows" -> "Modules" .

You can right click a row and there is the option "Load Symbols" which lets you sepecifiy a pdb file to load.

在这里输入图像描述

Loading the symbols automatic

Visual studio also loads the symbols automaticly when they can be found in one of the following places.

  • The location that is specified inside the DLL or the executable file. (By default, if you have built a DLL or an executable file on your computer, the linker places the full path and file name of the associated .pdb file inside the DLL or the executable file. The debugger first checks to see if the symbol file exists in the location that is specified inside the DLL or the executable file. This is helpful, because you always have symbols available for code that you have compiled on your computer.)

  • .pdb files that could be present in the same folder as the DLL or executable file.

  • Any local symbol cache folders.
  • Any network, internet, or local symbol servers and locations that are specified on, such as the Microsoft symbol server if enabled.
  • 在这里输入图像描述

    If you want to read more about how the symbols are used with visual studio you can read this article about Understanding symbol files and Visual Studio's symbol settings .

    链接地址: http://www.djcxy.com/p/74568.html

    上一篇: 在Symbol包中使用PDB和源文件进行调试

    下一篇: 在Visual Studio中使用Pdb文件和源代码文件进行调试