如何处理 System.StackOverflowException
2014-05-12 17:08
253 查看
.Net 2.0 以后 StackOverflowException 异常会导致整个进程退出,无法catch该异常,即便用AppDomain隔离也一样。
唯一的办法是通过 ICLRPolicyManager,我没有深究,有兴趣的同学 参考:ICLRPolicyManager Interface
如果你碰到这种程序崩溃又无法记录日志的情况,可以先检查一下“Windows事件管理器”
看是否有 异常代码: 0xc00000fd
如果有,很有可能是你代码里面包含无法终止的递归调用,睁大眼睛,仔细检查吧,我没辙了哈。
参考:
StackOverflowException Class
Troubleshooting Exceptions: System.StackOverflowException
C# catch a stack overflow exception
唯一的办法是通过 ICLRPolicyManager,我没有深究,有兴趣的同学 参考:ICLRPolicyManager Interface
如果你碰到这种程序崩溃又无法记录日志的情况,可以先检查一下“Windows事件管理器”
看是否有 异常代码: 0xc00000fd
如果有,很有可能是你代码里面包含无法终止的递归调用,睁大眼睛,仔细检查吧,我没辙了哈。
参考:
StackOverflowException Class
Troubleshooting Exceptions: System.StackOverflowException
C# catch a stack overflow exception
相关文章推荐
- 关于 未处理System.StackOverflowException的一种处理方法
- 未处理的“System.StackOverflowException”类型的异常出现在 mscorlib.dll
- “System.StackOverflowException”类型的未经处理的异常出现在 mscorlib.dll 中。
- “System.StackOverflowException”类型的未经处理的异常在 mscorlib.dll 中发生
- “System.StackOverflowException”类型的未经处理的异常在 mscorlib.dll 中发生
- 未处理的“System.StackOverflowException”类型的异常出现在 mscorlib.dll(转)
- “System.StackOverflowException”类型的未经处理的异常出现在...[解决方案]
- 处理[未处理的“System.StackOverflowException”类型的异常出现在 System.Windows.Form.dll]异常
- 未处理的“System.StackOverflowException”类型的异常出现在 mscorlib.dll
- 未处理的“System.StackOverflowException”类型的异常出现在 mscorlib.dll
- 未处理的“System.StackOverflowException”类型的异常出现在 mscorlib.dll
- 使用过多的递归出现错误,“System.StackOverflowException”类型的未经处理的异常在 mscorlib.dll 中发生
- “System.StackOverflowException”类型的未经处理的异常在 MySql.Data.dll 中发生”的错误处理
- 处理[未处理的“System.StackOverflowException”类型的异常出现在 System.Windows.Fo ...
- System.StackOverflowException
- 执行foreach时出现An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll的错误查解
- An unhandled exception of type 'System.StackOverflowException'
- InitializeComponent System.StackOverflowException
- System.StackOverflowException,事件中的问题
- System.StackOverflowException 的异常;jit调试失败