private static void RunFromConsole() { ConsoleManager.Show(); var service = new ScanService(Settings.Default.Port); try { service.Start(); Console.WriteLine("Press any key to stop service"); Console.ReadKey(); } catch (Exception e) { Console.WriteLine(e); } finally { service.Stop(); } }