Create an Account
username: password:
 
  MemeStreams Logo

ASP.NET Internals Spelunking

search

Worthersee
Picture of Worthersee
My Blog
My Profile
My Audience
My Sources
Send Me a Message

sponsored links

Worthersee's topics
Arts
Business
Games
Health and Wellness
Home and Garden
Miscellaneous
Current Events
Recreation
Local Information
Science
Society
Sports
Technology

support us

Get MemeStreams Stuff!


 
ASP.NET Internals Spelunking
Topic: Technology 4:37 pm EST, Jan 23, 2008

When I wrote the ASP.NET book I pretty much lived in Reflector 24/7 to figure out all the gory implementation details. Back then it would have been great to be able to simply set breakpoints in some of the low level classes like HttpRuntime or modules.

Fortunately this is now possible, here's a quick walkthrough:

* Set up your Visual Studio to work with the new .NET symbols. Also have a look at the various symbol loading options you have.
* Open an ASP.NET app
* Set a breakpoint somewhere in your code (e.g. in a Page_Load)
* Let the debugger hit the breakpoint
* Open the call stack window and navigate up the stack, e.g. to HttpRuntime.ProcessRequest or Page.ProcessRequest
* Set a breakpoint (use HttpRuntime.Init or the (c)ctor to step through the whole initialization process)
* Right click the breakpoint, select location and check the "Allow the source code to be different from the original version" option.
* Debug again. The debugger should now hit the breakpoint in the ASP.NET infrastructure class
* Depending on how early in processing you set the breakpoint, you may have to recycle the AppDomain to start over. Simply make a change to web.config and save to trigger recycling.

This is a reminder for me to try again at getting ASP.NET Regex Validators to fail. I tried a few months ago while waiting at the airport for my connecting flight. Other than making the Regex.Match thread hang with backtracking I was unable to make the regex validator fail.

I was only poking around with Reflector before, but thanks to Dominick Baier for reminding me that I can now hook a debugger to the code I previously couldn't.

ASP.NET Internals Spelunking



 
 
Powered By Industrial Memetics
RSS2.0