protected override void OnStart(string[] args) { #if DEBUG Debugger.Launch(); #endif _hostService = new HostService(_logger, PluginConfigurationSection.Instance); _hostService.OnStart(args); }
private void LaunchConsoleApplication(string[] args) { try { HostService hostService = new HostService(_logger, PluginConfigurationSection.Instance); hostService.OnStart(args); Console.WriteLine("Services running. Press enter to shutdown the services and exit."); Console.ReadLine(); hostService.OnStop(); } catch (Exception e) { Console.WriteLine("An exception was thrown by the application."); Console.WriteLine(); Console.WriteLine("Exception:"); Console.WriteLine(e.Message); Console.WriteLine(); Console.WriteLine("Stack trace:"); Console.WriteLine(e.StackTrace); Console.ReadLine(); } }