首先捕获机会异常托管代码中没有正在调试 [英] Catching First Chance Exceptions in Managed Code without being debugged

查看:85
本文介绍了首先捕获机会异常托管代码中没有正在调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法赶上第一次机会异常,并记录他们没有一个调试器下运行?

Is there a way to catch First-Chance exceptions, and log them without running under a debugger?

我想另一种方式来问的问题是,我可以写东西会像一个调试器附加到我的过程,看到了什么错误,而它发生?

I suppose another way to ask the question is can I write something that will act like a debugger being attached to my process and see what is going wrong while it happens?

推荐答案

如果你是在.NET 4.0中,你可以使用 AppDomain.FirstChanceException 事件得到异常的通知。

If you are on .NET 4.0, you can use theAppDomain.FirstChanceExceptionevent to get notification of exceptions.

这篇关于首先捕获机会异常托管代码中没有正在调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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