Source cannot be found - step through disassembly
I have an ASP.NET web app. I reference an external .dll, made by another team member.
When first stepping through my code (which calls thi开发者_如何转开发s dll's class and method), I get an error (runtime of course) stating that the source cannot be found and if I want to step through disassembly.
What causes this? Also, is it possible to add .pdb files to a project's references?
Thanks
Add a reference to the DLL from the same folder that contains the PDB.
To do full source-level debugging, you need two things: 1) the symbol file (PDB) for the DLL and 2) the source code used to build the DLL.
You can see if the PDB for the module is loaded by opening the debugger's Modules window (Debug -> Windows -> Modules (Ctrl + Alt + U)) and looking at the "Symbol Status" field for the DLL you care about. If it says "No symbols loaded.", then you can right-click and load the symbols from wherever you have them on disk/network. By default, the debugger will look next to the DLL and next to the debuggee (.exe) for symbols.
Even if you have the PDB for the external DLL loaded in the debugger, you don't necessarily have the source. When this happens, the debugger does as good as it can by giving you the option to step through disassembly.
精彩评论