Catching First Chance Exceptions in Managed Code without being debugged [duplicate]

强颜欢笑 提交于 2019-12-07 05:02:42

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/3888670/catching-first-chance-exceptions-in-managed-code-without-being-debugged

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!