private static void Main(string[] args) { AppDomain.CurrentDomain.UnhandledException += OnUnhandledException; var options = new Options(); if (args.Any()) { Parser.Default.ParseArgumentsStrict(args, options, () => Console.WriteLine("Bad command line parameters.")); } if (Environment.UserInteractive || options.IsConsole) { var service = new AggregatorService(options); service.StartConsole(); } else { ServiceBase.Run(new AggregatorService(options)); } }
private static void Main(string[] args) { AppDomain.CurrentDomain.UnhandledException += OnUnhandledException; var options = new Options(); if (args.Any()) { CommandLine.Parser.Default.ParseArgumentsStrict(args, options, () => Console.WriteLine("Bad command line parameters.")); } if (Environment.UserInteractive || options.IsConsole) { var service = new AggregatorService(options.OnlyUsers); service.StartConsole(); } else { ServiceBase.Run(new AggregatorService(options.OnlyUsers)); } }