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)