I have a program that is written to run in the foreground. But it backgrounds itself on some machines.
Here is the context.
I have a class derived from ServiceBase,
public class MyService: ServiceBase
For debug purposes, I do not start the service as follows:
ServiceBase.Run(myService);
Instead, I invoke the OnStart directly as follows, and sleep forever:
myService.OnStart(null);
System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);
For some reason the process is backgrounding itself on the production machine. Ideas?