How do you exit a Windows Service programmatically from within the service?
I am creating a windows service application. It has a configuration file that is checked at startup. If the configuration file isn't correct, I want to stop the service. What is the best way to do this? A C# code example would be very useful.