简体   繁体   中英

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!

How is it possible?

替代文字

Oh, and I know you shouldnt have an empty catch block, that's not my question.

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...

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. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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