Blog Archive

Search Blog

Blog List

Contact Me






Enter the code shown above in the box below
Send

 

Announcements

Recommended Websites

Events

Event StartEvent EndTitle

Recommended Reading

Most recent blog entries

May 31

Written by: Darren McLeod
Sunday, May 31, 2009 5:55 AM 

If you are working on a web application that has added code to the Global.asax that logs and clears all unhandled exceptions, down the road in the development/maintenance unit test cycle you may forget to check that any errors have occurred during your live testing and can’t figure out why your application isn’t working correctly.  To prevent this from happening to you and other developers on your project add a Debug.Assert message just before the code that logs the unhandled exception. For example:

 

Debug.Assert(False, String.Format("Exception about to be logged to database:{0}", unhandledException))

 

Then when you are running in debug mode and an unhandled exception occurs you will get a popup like this:

 

 

 

Tags:

Your name:
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Security Code
Enter the code shown above in the box below
Add Comment   Cancel