O'Reilly logo

Beginning ASP.NET 4.5.1: in C# and VB by Imar Spaanjaars

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 18Exception Handling, Debugging, and Tracing

WHAT YOU WILL LEARN IN THIS CHAPTER:

  • How to write code that is able to detect and handle errors that occur at run time, at the same time shielding your users from the error details
  • How to detect errors that occur on your production machine so you can take countermeasures
  • What debugging is and what debugging tools VS offers
  • What tools you can use to gain information about your system and code while it’s running in a development or production environment

WROX.COM CODE DOWNLOADS FOR THIS CHAPTER

You can find the wrox.com code downloads for this chapter on the Download Code tab at www.wrox.com/go/begaspnet451. The code is in the Chapter 18 folder.

You can’t make an omelet without breaking eggs and you cannot write code without creating bugs. No matter how hard you try and how good you are, your code will contain problems that affect the behavior of your website.

Of course you should strive to minimize the impact of these bugs, aiming for a “zero bug count.” To aid you in this, the ASP.NET run time and Visual Studio provide you with a number of tools.

First of all, the languages supported by .NET implement exception handling, a methodology to identify and handle errors that occur at run time. By handling these errors, you can present your users a friendly error message. At the same time, you can log these errors, giving you a chance to fix them before they reoccur. In this chapter, you see how exception handling works, and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required