static void Main(string[] args) { AppDomain.CurrentDomain.AssemblyResolve += (s, e) => ResolveAssembly(e.Name); var arguments = new HostArguments(args); if (arguments.Help) { arguments.PrintUsage(); return; } var loggingSettings = new LoggingSettings(arguments.ServiceName); LoggingConfigurator.ConfigureLogging(loggingSettings); new CommandRunner(arguments.Commands).Execute(arguments); }
static async Task Main(string[] args) { AppDomain.CurrentDomain.AssemblyResolve += (s, e) => ResolveAssembly(e.Name); var arguments = new HostArguments(args); if (arguments.Help) { arguments.PrintUsage(); return; } var loggingSettings = new LoggingSettings(arguments.ServiceName, logToConsole: !arguments.RunAsWindowsService); LoggingConfigurator.ConfigureLogging(loggingSettings); await new CommandRunner(arguments.Commands).Execute(arguments) .ConfigureAwait(false); }