I have an old old Windows service (inheriting from System.ServiceProcess.ServiceBase) to which I added a component (implementation of IComponent) to this.components.Add(new MyStuff());
However, MyStuff Disposable() does not start if I disable exe from task manager.
Possible suspects:
- Nothing starts in the "End Process". If so, how can I clean up after myself (for example, did the processes start to kill?)
For testing purposes, I start my service with
var service = new MyService();
service.Run();
Thread.Wait(Timeout.Infinite);
instead of ServiceBase.Run(new []{new MyService()}); might be a problem?
- ServiceBase is not cleared automatically. If so, what should I do?
Please, help!
Additional info: I'm trying to close other exes that I started with my service using Process.Start (...), so if there is a way to make them autocomplete (a child process?), Which is also good.
source share