using winService; IHost host = Host.CreateDefaultBuilder(args) .UseWindowsService() .ConfigureServices(services => { services.AddHostedService(); }) .Build(); await host.RunAsync();