View the current exception in Visual Studio

Sometimes you write pieces of code like this.

1
2
3
 catch
        {
          LogException(....

This type of exception handler catch everything and log, despite the fact that is not so good practice to catch every exception that a piece of code could raise, one of the most frustrating thing is that if you place a breakpoint in the LogException line, since you have not specified in the catch clause no exception you have no way to see detail of the exception.

You should know that you can see current exception detail in watch windows with the special syntax $exception or @exception

image

But if you want, the same information is always displayed in the local windows. This is a basic functionality of visual studio, but many people does not know it ;)

Alk.

Tags: Visual Studio .Net Framework

DotNetKicks Image