I have a third-party DLL (CSLA) which is referenced withing my project. Now开发者_高级运维 it all works OK, but when there is an exception thrown from CSLA for whatever reason, it shows the disassembly with the memory addresses etc. I would like to actually see the source code. I have done the following and still no difference.
- Disable debugging in my just my code option in Visual Studio 2010.
- Check the symbol files are being loaded ( Debug --> Windows --> Modules) and seems as though they are.
Is my assumption correct that as long as there is .pdb file being loaded then I should be able to debug into source code?
Why can't I get the debugger to show the source code?
No. The .pdb alone does not include the source code. It's just a mapping file for IL-location => source code line.
.NET Reflector Pro (the non-freeversion) enables you to step into external libraries code.
Actually pdb file will not guarantee that you will be able to step through the source code. PDBs contains informations about locations of sources, so you have to get the sources to do such debugging. One thing you can do is to use Debug -> Exceptions option. You have to check box with exception you obtain (or add a new one) and debug your application. Next time you will brake at the moment of throwing exception and you will be able to collect stack traces.
Do you actually have the source code for the 3rd party DLL? If not, then that's why you can't see it.
The paid-for version of Reflector (http://www.red-gate.com/products/reflector/) can debug into 'decompiled' code, which is often surprisingly clear. This only works if the DLL you're having a problem with is a .NET assembly, which I'm not 100% certain it is from your question.
精彩评论