I have an exe file. Lets call it X.exe It is a console application that I created using C#.
However, it hangs abruptly and I have to manually start it over again. I do not want to make any changes to the code.
I know we can use ProcDump or Process monitors from windows sysinternals.
Can I use them to monitor my x.exe ang get alerted on email when the process hangs?
If so, what specific command should I send over?
If not, what else should I use to solve this problem?
Edit/Add on: Should I use create a windows service, identify the process using .net’s process.GetProcessByName function and check if its still running?
You can handle that with, for example :
AppDomain.UnhandledException event, by subscribing to it and inside the method
In this way you have one central point where your application will receive the exception not handled by your code and can process them in centralized way.
Just remember that, for example
StackOverflowExceptioncan not be handled.Good luck.