static void Main(string[] args) { Service service = new Service(); service.Start(); System.Console.Read(); }
static void Main(string[] args) { var port = 12345; if (args.Length == 1) Int32.TryParse(args[0], out port); var service = new Service(port); service.Start(); Console.WriteLine("Press ENTER to stop"); if (Console.Read() == (int) ConsoleKey.Enter) service.Stop(); }
static void Main(string[] args) { Log.Logger = new LoggerConfiguration() .WriteTo.Console() .CreateLogger(); var svc = new Service(); svc.Start(); Console.WriteLine("key"); Console.ReadKey(true); svc.Stop(); Log.CloseAndFlush(); }