コード例 #1
0
ファイル: Program.cs プロジェクト: sergioc/ServiceControl
        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);
        }
コード例 #2
0
        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);
        }