积极答复者
第一次遭遇FatalExecutionEngineError

问题
-
WindowApp中有双击dataGridView1单元格内容时触发的事件
private void dataGridView1_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
{
int rowIndex = e.RowIndex;
string str = dataGridView1.Rows[rowIndex].Cells[0].Value.ToString();
}
当我不断单击dataGridView1标题栏的某个单元格中的内容时,发生了这样的异常:
1、
检测到 FatalExecutionEngineError
Message: 运行库遇到了错误。此错误的地址为 0x79fce5c2,在线程 0xa4c 上。错误代码为 0xc0000005。此错误可能是 CLR 中的 bug,或者是用户代码的不安全部分或不可验证部分中的 bug。此 bug 的常见来源包括用户对 COM-interop 或 PInvoke 的封送处理错误,这些错误可能会损坏堆栈。2、点击此弹出面板中的“继续”按钮时,转到下面的面板。
未处理 System.ExecutionEngineException
Message: 未处理的“System.ExecutionEngineException”类型的异常出现在 未知模块 中。
注:我两次单击的时间可能有时比较短,可能被认为是双击,但是当我真正双击时发生的异常是ArgumentOutOfRangeException。
请问:为什么会发生“检测到 FatalExecutionEngineError”和“未处理 System.ExecutionEngineException”
Spark
答案
-
我试着想重现这个问题,似乎重现不了。
有可能是你的CLR损坏了,先重新装一个试试。对于这样的问题,也有可能是vs本身的问题。
对于上面的代码的话,最好是加一些判断了。这样的话可以阻止用户点击标题栏。也就不会出现这个异常了。
Cookie Luo[MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- 已标记为答案 mldarkMember 2011年5月10日 18:15
全部回复
-
你好
这个问题经常出现吗?还是偶然出现了这一次?
http://msdn.microsoft.com/zh-cn/library/ms242232.aspx
http://msdn.microsoft.com/zh-cn/library/ms228990.aspx
Cookie Luo[MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
-
我试着想重现这个问题,似乎重现不了。
有可能是你的CLR损坏了,先重新装一个试试。对于这样的问题,也有可能是vs本身的问题。
对于上面的代码的话,最好是加一些判断了。这样的话可以阻止用户点击标题栏。也就不会出现这个异常了。
Cookie Luo[MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- 已标记为答案 mldarkMember 2011年5月10日 18:15