如何在调试时查看异常?

Jad*_*ias 5 .net c# debugging logging exception

我正在使用这样的NLog

try
{
    // ... some code
}
catch(AException ex)
{
    logger.ErrorException(ex.Message, ex);
}
Run Code Online (Sandbox Code Playgroud)

但我希望在调试时看到异常.所以我尝试过:

#if !DEBUG
    try
    {
#endif
        // ... some code
#if !DEBUG
    }
    catch(AException ex)
    {
        logger.ErrorException(ex.Message, ex);
    }
#endif
Run Code Online (Sandbox Code Playgroud)

有更简洁的方法吗?

Mit*_*eat 6

启用First Chance Exceptions:CTRL-ALT-E(勾选CLR异常的抛出列)

在此输入图像描述