WaitForDebugEvent () API for .NET

I have a launcher application that creates a process and controls it using the WaitForDebugEvent / ContinueDebugEvent API functions. This application was written by me in C ++ and it works great for unmanaged applications.

I also have a .NET application that crashes accidentally. I wanted to use the laucher app to catch the exception, write a minidump and examine it using WinDbg. But unfortunately the WaitForDebugEvent / ContinueDebugEvent combination does not work for .NET applications. When an exception occurs, the .NET application is silently closed and the launcher application fires no exceptions at all, just like everything is fine. Even if some kind of exception happened in this situation, it was mysteriously handled by something unknown to me.

Is there any special way to handle .NET? Some special API calls for catching .NET "special" exceptions and so on. Google didn't help at all.

+3


source to share


1 answer


You can add an event handler for AppDomain.UnhandledException in .Net and catch all exceptions thrown from .Net.



0


source







All Articles