I'm using NLog like this
try
{
// ... some code
}
catch(AException ex)
{
logger.ErrorException(ex.Message, ex);
}
But I want to see the exception when debugging. So I tried:
#if !DEBUG
try
{
#endif
// ... some code
#if !DEBUG
}
catch(AException ex)
{
logger.ErrorException(ex.Message, ex);
}
#endif
Is there a neater way of doing that?
Turn on First Chance Exceptions: CTRL-ALT-E (tick the thrown column for CLR exceptions)
Don't do it this way. It's better to turn on Exception notification on Debug->Exceptions. This way you will see exceptions when they are created even if they are handled latter on.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With