Exemplo n.º 1
0
 private static async Task <int> Main(string[] args)
 {
     return(await HostRunner.Create(args).Configure(
                config => config
                .AddSystemServices(
                    fileSystemOptions: async(options) => {
         options.SetDataPath(DefaultPath.Application);
         options.CreateLockFile = true;
         await Task.CompletedTask;
     }
                    )
                .AddUtility()
                .AddAppWorker <Program>()
                ).Build().RunAsync());
 }
Exemplo n.º 2
0
 private static async Task <int> Main(string[] args)
 {
     return(await HostRunner.Create(args).Configure(
                config => {
         config
         .AddSystemServices(
             fileSystemOptions: async(options) => {
             options.SetDataPath(DefaultPath.Application);
             options.CreateLockFile = false;
             await Task.CompletedTask;
         },
             settingsSystemOptions: async(options) => {
             options.CreateNewSettings = ()
                                         => new CustomSettings(new EnvironmentSettings()
             {
                 OutputReadableXML = false,
                 Locale = "en",
                 EnableLogging = true
             });
             await Task.CompletedTask;
         },
             commandLineOptions: async(options) => {
             options.AllowOverrideSettings = false;
             await Task.CompletedTask;
         },
             loggingSystemOptions: async(options) => {
             options.FileFactory = (stream) => new TextAndXmlLogFile(stream);
             options.CheckServiceState = true;
             options.LogOnUpdate = true;
             options.UseLongName = true;
             await Task.CompletedTask;
         }
             )
         .AddAppWorker <Program>();
         config.UnhandledError += Config_UnhandledError;
     }
                ).Build().RunAsync());
 }