E***@gmail.com
2007-06-12 00:59:04 UTC
In a C# Application, I'm using a service controller to Start() a
service also written in .NET.
In the OnStart() of the Service I may have an occasion to Stop the
service if something goes wrong, and would like to let the application
that is attempting to start it know just what went awry.
As opposed to using something complicated like .NET remoting or some
other inter app communications, I'd like to simply set the ExitCode
value in the Service and retrieve it from the ServiceController of the
starting app.
However, I see no way to get the exit code from the ServiceController
instance that's trying to Start() the service.
Any ideas on how to get the ExitCode?
I suspect I may have to create a Process object, via
Process.GetProcessById() or GetProcessByName() and then watch for the
ExitCode there?
Thanks
Eric
service also written in .NET.
In the OnStart() of the Service I may have an occasion to Stop the
service if something goes wrong, and would like to let the application
that is attempting to start it know just what went awry.
As opposed to using something complicated like .NET remoting or some
other inter app communications, I'd like to simply set the ExitCode
value in the Service and retrieve it from the ServiceController of the
starting app.
However, I see no way to get the exit code from the ServiceController
instance that's trying to Start() the service.
Any ideas on how to get the ExitCode?
I suspect I may have to create a Process object, via
Process.GetProcessById() or GetProcessByName() and then watch for the
ExitCode there?
Thanks
Eric