catching another processes exception in C#

Is it possible to monitor another process for exceptions Lets say I have a windows app that throws an exception, can I catch that exception in 2nd process for logging Is this possible in .net

Also, is there a .net dll or system dll that throws these exceptions that perhaps I could hook into Kind of like hooking into user32.dll and catching mouse events. Do exceptions work the same way

Orr......when the exception is thrown, does it send a windows message like other events do, such as resize event, key stroke event, etc...


Answer this question

catching another processes exception in C#

  • jeje1g

    You'd need to attach to the process as a debugger. The debugging API in Windows is Win32 native API calls so it's not really a good candiate for writing in C# - C/C++ would be the way you'd want to go here.

    Here's a bit more info on the basics: http://win32assembly.online.fr/tut28.html



  • catching another processes exception in C#