Google+ Peter Bromberg's .NET Blog | Two Useful Debugging Tricks Most Developers Don't Know

Peter Bromberg's .NET Blog All Things Programming

Two Useful Debugging Tricks Most Developers Don't Know

7. August 2016 16:22 by admin in

1. Put in a Global Unhandled Exception handler in your ASP.NET / MVC applications:

 

There are many places where developers don't handle exceptions. Use the above code and set a breakpoint where shown. Any time an unhandled exception is thrown, your breakpoint will be hit. You can examine the eception and look at the stack trace portion to see exactly what went wrong.

 

2. Turn on exact debugger breaking in Exception Settings

 

At the top menu, choose Debug/Windows/Exception Settings. (Ctrl-D, E) Make sure the "Common Language Runtime Exceptions" Is fully checked. What this does is that whenever an exception is generated, the debugger will break at the exact line where the exception was thrown, making your job both easier and more efficient.

Here's to using your noggin' as a developer!

Add comment

  Country flag


Loading