Sometimes you need to debug internals of ASP.Net. It helps to understand some important aspects of functioning of the framework and improves the understanding of how it works in general. Here is the good article which explains how to configure Visual Studio for debugging .Net code (which of course includes ASP.Net code): Configuring Visual Studio to Debug .NET Framework Source Code. This article was written for VS2008, in VS2010 and VS2012 steps are almost the same, bug there are several improvements. First of all there is new “Enable .NET Framework source stepping” setting:
This msdn article How to: Debug .NET Framework Source says that we need to check it in order to be able to step into the .Net code. However on practice I was able to debug .Net code even with having it unchecked.
Another improvement is having preconfigured Microsoft Symbols Servers option in Tools > Debugging > Symbols:
So now you don’t need to add and configure it manually.
Ok, so you did all described steps, tried to debug your ASP.Net application, set breakpoint e.g. in Page_Load method of your page and in Call Stack window can see that symbols for whole stack are loaded properly:
Also if you will check Symbol Load Information from the context menu:
you will see that symbols are successfully loaded:
However if you will try to double click on any row in Call Stack window you may see the message that source code is unavailable:
It may be confusing because you did everything according to instructions which you found in many blog posts and forums. However there is one more important thing which you should do. In order to debug ASP.Net code use real IIS web server in the project settings instead of Visual Studio Development Server:
After you will change project settings and click on some .Net internal call from Call Stack you will see the .Net source code:
Hope that this information will help you during the debugging.
No comments:
Post a Comment