static void Main(string[] args) { IAppHost host = new AppHostBuilder() .UseArguments(args) .ConfigureServices(s => s.AddSingleton <IDemo, Demo>()) .Build(); host.Run(app => { var demo = app.Services.GetRequiredService <IDemo>(); app.Arguments.ToList().ForEach(arg => Console.WriteLine(arg)); Console.ReadKey(); }); }