using System.Diagnostics; using System.ServiceProcess; using System.Threading; namespace bsmd.AIS2Service { internal static class Program { /// /// The main entry point for the application. /// static void Main() { log4net.Config.XmlConfigurator.Configure(); if (Debugger.IsAttached) { AISManager.Start(); // TODO wait some Thread.Sleep(120000); // Test finish.. AISManager.Stop(); } else { ServiceBase[] ServicesToRun; ServicesToRun = new ServiceBase[] { new AIS2_Service() }; ServiceBase.Run(ServicesToRun); } } } }