您的位置:首页 > 其它

Vlc ReleaseMediaPlayer 异常捕获

2015-03-30 13:58 344 查看
In .NET 4.0, the runtime handles certain exceptions raised as Windows Structured Error Handling (SEH) errors as indicators of Corrupted State. These Corrupted State Exceptions (CSE) are not allowed to be caught by your standard managed code. I won't get into
the why's or how's here. Read this article about CSE's in the .NET 4.0 Framework:

http://msdn.microsoft.com/en-us/magazine/dd419661.aspx#id0070035

But there is hope. There are a few ways to get around this:

Recompile as a .NET 3.5 assembly and run it in .NET 4.0.

Add a line to your application's config file under the configuration/runtime element:
<legacyCorruptedStateExceptionsPolicy
enabled="true|false"/>


Decorate the methods you want to catch these exceptions in with the
HandleProcessCorruptedStateExceptions
attribute.
See http://msdn.microsoft.com/en-us/magazine/dd419661.aspx#id0070035 for
details.

For more reference: http://connect.microsoft.com/VisualStudio/feedback/details/557105/unable-to-catch-accessviolationexception
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: