Visual Studio 2010上的静默异常 [英] Silent Exception On Visual Studio 2010

查看:79
本文介绍了Visual Studio 2010上的静默异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

private void button1_Click(object sender, EventArgs e)
{
    ///IDE will notify me of this exception  
    throw new Exception();
}

private void Form1_Load(object sender, EventArgs e)
{
    //IDE will not notify me of this exception  
    throw new Exception();


    //code will not execute  
    MessageBox.Show("test");
}

为什么?

----------------------编辑----------------------

正确的答案是 ChrisA 所提到的。
来自微软的一些报价:

----------------------EDITED----------------------
the correct answer is what ChrisA mentioned. some quotes from microsoft :


这是x64版本Windows中
的已知错误,异常的处理方式
已处理。解决调试时
问题的一种方法是转到
Debug-> Exceptions,然后为您感兴趣的
异常类型选择
'Thrown'。当异常是第一次击中
时(在Windows将其吞噬
之前),调试器将停止

This is a known bug with x64 versions of Windows and the way exceptions are handled. One way to work around this issue while debugging is to go to the Debug -> Exceptions and select 'Thrown' for for the exception types you are interested in. This will stop the debugger when the exception is first hit (and before Windows eats it up).








此错误已作为外部
关闭,因为此行为是由
x64版本的Windows处理
例外。当用户模式异常
跨内核转换时,x64
Windows版本不允许
异常传播。因此,附加了
的调试器没有意识到
发生
异常的事实,导致调试器无法在
的未处理异常处中断。

This bug was closed as "External" because this behavior results from how x64 version of Windows handle exceptions. When a user mode exception crosses a kernel transition, x64 versions of Windows do not allow the exception to propagate. Therefore attached debuggers are unaware of the fact that an exception occured resulting in the debugger failing to break on the unhandled exception.

不幸的是,Visual Studo团队无法解决
的问题,这是
操作系统设计的结果。有关此问题的所有反馈
应该发送给Windows小组
;但是Windows团队认为

是正确的操作系统设计,
并认为x86行为是
不正确。

Unfortunately where is nothing that the Visual Studo team can do to address this, it is the result of operating system design. All feedback regarding this issue should be addressed to the Windows team; however the Windows team considers this to be the "correct" operating system design, and considers the x86 behavior to be "incorrect".








此修补程序尚未经过完整的
测试。因此,仅打算将
的系统或计算机遇到
的确切问题,这是一个或多个Microsoft
知识库文章
中描述的
在此电子邮件
消息末尾的表中的知识库文章编号字段
中列出。如果您不确定
是否有任何特殊兼容性或
安装问题与此修补程序相关联
,我们鼓励您
等待下一个Service Pack
的发布。该Service Pack将包含
此修复程序的经过全面测试的版本。我们
理解
很难确定是否有任何兼容性或
安装问题与
与一个修补程序相关联。如果您希望
确认此修复程序
解决了您的特定问题,或者如果
您想确认是否有任何
特殊兼容性或安装
问题与此$相关联b $ b修复程序,
客户支持服务中的支持专业人员可以为您提供帮助。

This hotfix has not undergone full testing. Therefore, it is intended only for systems or computers that are experiencing the exact problem that is described in the one or more Microsoft Knowledge Base articles that are listed in "KB Article Numbers" field in the table at the end of this e-mail message. If you are not sure whether any special compatibility or installation issues are associated with this hotfix, we encourage you to wait for the next service pack release. The service pack will include a fully tested version of this fix. We understand that it can be difficult to determine whether any compatibility or installation issues are associated with a hotfix. If you want confirmation that this hotfix addresses your specific problem, or if you want to confirm whether any special compatibility or installation issues are associated with this hotfix, support professionals in Customer Support Services can help you with that.


推荐答案

您是否正在x64机器上进行开发?

Are you developing on an x64 machine?

如果是这样,您可能希望看看

If so, you might like to have a look at this.

该线程还引用整个问题的非常详细的解释

这和另一个放映机(无论如何对我来说,变通方法对我或我的同事都无效),导致重建了我的开发箱使用win7 x86。

This, and another show stopper (for me anyway, the workarounds didn't work for me, or my colleague) on x64, resulted in a rebuild of my dev box with win7 x86.

问题现在已经消失了。但这非常令人失望。

The problems have all gone away now. But it's very disappointing.

这篇关于Visual Studio 2010上的静默异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆