我如何能赶上另一个进程的未处理的异常?进程、异常、未处理

2023-09-04 11:21:08 作者:彼此安好互不扰

我要修改或只需加载.NET可执行文件,然后处理其未处理的异常。 我的目标是做一个聪明的处理程序,可以发送堆栈跟踪。

I want to modify or just load a .NET executable and then handle its unhandled exceptions. My goal is to make a smart handler which can send the stack traces.

推荐答案

假定其他可执行文件是一个.NET应用程序,将其加载到一个新的 的AppDomain 并运行它。当目标可执行抛出一个异常,你会得到 AppDomain.FirstChanceException事件

Assuming that the other executable is a .NET application, load it into a new AppDomain and run it there. When the target executable throws an exception, you get AppDomain.FirstChanceException Event.