I am a complete newbie to working with Windows services. I have a basic skeleton designed for a service, and currently I'm doing this:
protected override void OnStart(string[] args) { base.OnStart(args); Process.Start(@"someProcess.exe"); }
just to run exe at the beginning of the program.
However, I would like the service to stop when the process started with exe. I am pretty sure that I need to make some kind of thread (I also start with a newbie), but I'm not sure about the general way how this works and how to stop the process from the inside. Could you help me with a common process for this (i.e., start a thread from OnStart, then what ...?)? Thank you
multithreading c # windows-services
xdumaine
source share