Edit: So the actual problem wasn't that the process was dying, but that the process was stuck in an exception handler dialog waiting for the user to hit debug or cancel. The solution to the problem was to disable the .net JIT debug dialog, instructions here
http://weblogs.asp.net/fmarguerie/archive/2004/08/27/how-to-turn-off-disable-the-net-jit-debugging-dialog.aspx
My original proposed solution is below
Not a window service, but this is a pretty easy .NET program to write.
use System.Diagnostics.Process to get a Process object for the process you want to check. You can use GetProcessByName
if you want to open an existing process. If you create the process from C#, then you will already have the process object.
Then you just can WaitForExit
either with or without a timeout on the Process
object. or test the HasExited
property, or register an Exited
callback. Once the process has exited, you can check the ExitCode
property to find out whether the process returned an error value.