Sams Teach Yourself ASP.NET in 21 Days, Second Edition By Chris Payne
Table of Contents
Week 3. At a Glance
Today you're going to learn about a very important topic: debugging. No matter how strong a programmer you may be, we all make mistakes and debugging applications is a fact of life. The more code you write, the more bugs you'll create.
Chances are that you've come across many bugs in computer applications. Imagine all the times you've received messages, whether from a desktop application or a Web site, describing some error that you can't understand. Most of the time, those errors caused the application to crash; other times a bug caused the application to produce an output that you weren't expecting. Either way, you were not able to get done what you set out to do. Ideally, we could write code once and be done with it, but that's often not the case.
ASP.NET provides two great tools for debugging your applications: the Microsoft Common Language Runtime Debugger and the Trace Service. You'll learn about both of these today, as well as the try and catch blocks.
Today's lesson will cover the following:
How to use try and catch statements to debug
How to debug using Response.Write
How to create and throw your own custom errors
What the trace tool is and how to use it
How to perform runtime debugging with the CLR debuggers