且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

C#终结引发异常?

更新时间:2023-02-12 14:11:15

将您报价的来源是非常重要的。我必须假设它谈论一个老版本的.NET,也许1.x版本。它试图将未处理的异常的宽容,吞咽他们没有吱吱声。没有工作顺利,代码块默默失败是非常难以调试。

Linking the source of your quote is important. I have to assume it talks about an old version of .NET, perhaps version 1.x. It tried to be "tolerant" of unhandled exceptions, swallowing them without a squeak. That did not work out well, chunks of code silently failing is extraordinarily hard to debug.

在.NET 2.0版本杜绝的是,默认的CLR主机终止应用任何未处理的异常。在终结一个例外是致命的。

The .NET 2.0 version put an end to that, the default CLR host terminates the app for any unhandled exception. An exception in a finalizer is fatal.