【发布时间】:2019-05-12 10:43:33
【问题描述】:
当我使用 DebuggerNonUserCodeAttribute 并从委托或本地函数中抛出异常时,调试器会中断此异常。如果我按继续,则程序继续正常工作并处理异常。这很烦人。
这是错误还是功能?如何解决?
[DebuggerNonUserCode]
class Program {
static void Main(string[] args) {
try {
Action act = () => throw new Exception( "Hello World !" );
act();
} catch (Exception ex) {
Console.WriteLine( "Error" );
}
Console.Read();
}
}
更新
Visual Studio 为什么写:Exception User-Unhandled?
【问题讨论】:
标签: .net visual-studio debugging exception