using System.Diagnostics; using System.ServiceProcess; namespace SendNSWMessageService { static class Program { /// /// The main entry point for the application. /// static void Main(string[] args) { ServiceBase[] ServicesToRun; log4net.Config.XmlConfigurator.Configure(); ServicesToRun = new ServiceBase[] { new NSWSendService() }; if (Debugger.IsAttached) { ((NSWSendService)ServicesToRun[0]).DoOnce(); } else if(args.Length > 0) { ((NSWSendService)ServicesToRun[0]).Commandline(); } else { ServiceBase.Run(ServicesToRun); } } } }