避免第一次机会异常消息异常安全的处理时, [英] Avoiding first chance exception messages when the exception is safely handled
问题描述
的code以下位捕捉EOS异常
The following bit of code catches the EOS Exception
using (var reader = new BinaryReader(httpRequestBodyStream)) {
try {
while (true) {
bodyByteList.Add(reader.ReadByte());
}
} catch (EndOfStreamException) { }
}
那么,为什么我仍然收到第一次机会异常在我的控制台?
So why do I still receive first-chance exceptions in my console?
有一个第一次机会异常的类型'System.IO.EndOfStreamException在mscorlib.dll中发生
A first chance exception of type 'System.IO.EndOfStreamException' occurred in mscorlib.dll
有没有一种方法来隐藏这些第一次机会异常消息?
Is there a way to hide these first chance exception messages?
推荐答案
的第一次机会异常的一点是,你看到他们的pre-处理程序,让您可以在在调试停在他们点投掷。 第二次机会的例外是,有没有相应的处理程序。有时候,你想赶上第一次机会异常,因为它,看看发生了什么,当它被抛出,即使有人被抓是很重要的。
The point of "first-chance" exceptions is that you're seeing them pre-handler so that you can stop on them during debugging at the point of throwing. A "second-chance" exception is one that has no appropriate handler. Sometimes you want to catch "first-chance" exceptions because it's important to see what's happening when it's being thrown, even if someone is catching it.
没有什么去关注。这是正常现象。
There's nothing to be concerned with. This is normal behavior.
这篇关于避免第一次机会异常消息异常安全的处理时,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!