我正在这样使用 NLog
try
{
// ... some code
}
catch(AException ex)
{
logger.ErrorException(ex.Message, ex);
}
但是我想在调试的时候看到异常。所以我尝试了:
#if !DEBUG
try
{
#endif
// ... some code
#if !DEBUG
}
catch(AException ex)
{
logger.ErrorException(ex.Message, ex);
}
#endif
有没有更简洁的方法?
最佳答案
打开 First Chance Exceptions:CTRL-ALT-E(为 CLR 异常勾选抛出的列)
关于c# - 调试时如何查看异常?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9584795/