Exemplo n.º 1
0
        private static async Task Main(string[] args)
        {
            Console.OutputEncoding = System.Text.Encoding.UTF8;

            var path    = Path.GetFullPath("openmod");
            var runtime = new Runtime.Runtime();
            var host    = await runtime.InitAsync(new List <Assembly> {
                typeof(Program).Assembly
            }, new RuntimeInitParameters
            {
                CommandlineArgs  = args,
                WorkingDirectory = path
            });

            var applifecycle = host.Services.GetRequiredService <IHostApplicationLifetime>();

            applifecycle.ApplicationStopped.Register(StandaloneConsoleIo.StopListening);

            StandaloneConsoleIo.StartListening();
        }