using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; namespace ReportingServices.Desktop { internal static class Program { /// /// The main entry point for the application. /// [STAThread] static void Main() { Application.SetHighDpiMode(HighDpiMode.SystemAware); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); var services = new ServiceCollection(); ConfigureServices(services); using (ServiceProvider serviceProvider = services.BuildServiceProvider()) { var form1 = serviceProvider.GetRequiredService(); Application.Run(form1); } } private static void ConfigureServices(ServiceCollection services) { services.AddSingleton() .AddLogging(configure => configure.AddConsole()); } } }