/// <summary> /// The main entry point for the application. /// </summary> static void Main() { AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; #if (!DEBUG) ServiceBase[] ServicesToRun; ServicesToRun = new ServiceBase[] { new emailerService() }; ServiceBase.Run(ServicesToRun); #else emailerService myServ = new emailerService(); myServ.Process(); Thread.Sleep(999999999); // here Process is my Service function // that will run when my service onstart is call // you need to call your own method or function name here instead of Process(); #endif }
/// <summary> /// The main entry point for the application. /// </summary> static void Main() { AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; #if(!DEBUG) ServiceBase[] ServicesToRun; ServicesToRun = new ServiceBase[] { new emailerService() }; ServiceBase.Run(ServicesToRun); #else emailerService myServ = new emailerService(); myServ.Process(); Thread.Sleep(999999999); // here Process is my Service function // that will run when my service onstart is call // you need to call your own method or function name here instead of Process(); #endif }