using GeoVLogSvc; using System; using System.ServiceProcess; internal static class Program { /// /// Application entry point. Runs the GeoVLogService as a Windows Service, /// or as a console app if in debug/interactive mode. /// static void Main(string[] args) { // Optionally, for debugging, run as console if launched interactively: #if DEBUG if (Environment.UserInteractive) { // In debug mode, run the service like a console application for testing. GeoVLogService service = new GeoVLogService(); service.StartConsole(args); Console.WriteLine("GeoVLogService running... Press Enter to exit."); Console.ReadLine(); service.StopConsole(); return; } #endif // Normal execution as Windows Service ServiceBase[] servicesToRun = new ServiceBase[] { new GeoVLogService() }; // This will block and start the service. The SCM will call OnStart, etc. ServiceBase.Run(servicesToRun); } }