Tuesday, September 15, 2009

Get Exception without being in catch block

In .NET, when exception is thrown, the exception passed though the call stacks. While debugging you may not be inside the catch block (may be in finally) or you may not have catch block at all. But if you want to still see what exception occurred then just go to 'watch' window in visual studio and type '$exception' and you will get the exception as it is.

Happy Debugging!

ps: I got this trick free from my ex-colleague Manish


Anonymous said...

Good, I know this tricks are known only to professional debugger (who spends most of his life in debugging rather than coding)

Yogee said...

Thanks anonymous! Looks like you know a lot about professional debugging. You are invited to look at my other blogs too.

J.B.B said...

yogee it seems u r pissed off..but that anonymous doesn't know the fun in debugging.. poor chap :D