using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging.Configuration; using Microsoft.Extensions.Logging.EventLog; using Microsoft.Extensions.Logging; using ParentalControlService; HostApplicationBuilder builder = Host.CreateApplicationBuilder(args); builder.Services.AddWindowsService(options => { options.ServiceName = "Marek Parental Control"; }); LoggerProviderOptions.RegisterProviderOptions(builder.Services); builder.Services.AddSingleton(); builder.Services.AddHostedService(); builder.Logging.AddConfiguration(builder.Configuration.GetSection("Logging")); IHost host = builder.Build(); host.Run();