How to check application is halt or working from a window service

Posted by malik on Stack Overflow See other posts from Stack Overflow or by malik
Published on 2010-04-08T09:47:41Z Indexed on 2010/04/08 9:53 UTC
Read the original article Hit count: 327

Filed under:
|

I have one WPF application and one windows service as watch dog.

I want to check if my window application is halt or working fine. If it is halt i want to restart the application.

I see Process.responding property but it is not working in my service.

Any idea or other solution.

 Process[] myProcesses;
        myProcesses = Process.GetProcessesByName(ApplicationName);
        if (myProcesses.Length > 0)
        {
            foreach (Process proc in myProcesses)
            {
                _Logger.LogMessage("Check responding");
                if (!proc.Responding)

© Stack Overflow or respective owner

Related posts about process

Related posts about system.diagnostics