简体   繁体   English

不寻常的异常行为?

[英]Unusual exception behaviour?

I have never come across this kind of behaviour before and I wondered if anyone is able to shed some light on the matter? 我之前从未遇到过这种行为,我想知道是否有人能够对此事有所了解?

So as you can see in the picture, I am catching exceptions of type AccessViolationException , and yet the debugger is complaining that the exception is unhandled! 因此,正如您在图片中看到的,我正在捕获类型AccessViolationException异常,但调试器却抱怨异常未处理!

How is it possible? 这怎么可能?

替代文字

Oh, and I know you shouldnt have an empty catch block, that's not my question. 哦,我知道你不应该有一个空的catch块,那不是我的问题。

Thanks! 谢谢!

Edit: Now I am getting this one instead: 编辑:现在我得到这个:

替代文字

Handling Corrupted State Exceptions is something you have to do explicitly, you can catch those by adding the [HandledProcessCorruptedStateExceptions] attribute to the function... 处理损坏的状态异常是您必须明确执行的操作,您可以通过向函数添加[HandledProcessCorruptedStateExceptions]属性来捕获它们...

Please note that these are unhandled with a reason as unexpected conditions can still be harmful if they are ignored or dealt with generically. 请注意,这些都是未处理的,原因是如果忽略或一般性地处理意外情况仍然有害。 There is no guarantee in either of these scenarios that what you're doing is completely safe! 在这些情景中,无法保证您正在做的事情是完全安全的! Only handle it in a scenario where just terminating the process is unacceptable. 只在刚刚终止进程不可接受的情况下处理它。

Odd things like this happen to me once in a while, I'm going to recommend the newbie IT method. 像我这样的奇怪的事情偶尔发生在我身上,我将推荐新手IT方法。 Restart your computer. 重启你的电脑。 The CLI Environment in .NET gets really buggy sometimes as I've had my code literally hang inside of a foreach loop before. .NET中的CLI环境有时会变得非常错误,因为我之前已经将代码放在foreach循环中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM