Jeremy Hutchinson listed out series of tips to be more productive in Visual Studio.
I was not aware of tip #2 - $exception Pseudovariable - Viewing uncaptured exception while debugging. Visual studio has a pseudo variable $exception
in the debug mode which will hold the details of the last exception. To explore $exception
, let’s create a small project:
|
|
Put a breakpoint at line 13 and run above code. The code will throw an exception and pause the execution in catch block. Now here you can use $exception
variable to inspect exception details.

Visual Studio - $exception variable
Thank you!
I appreciate your response on my blog.
It may take a while for your comment to display because I moderate comments to filter out spam and other forms of abuse. Thanks for understanding!