using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Windows.Forms; namespace StockInfoCore { static class Program { public static IConfiguration Configuration; /// /// The main entry point for the application. /// [STAThread] static void Main() { var builder = new HostBuilder() .ConfigureServices((_, services) => { services.AddDIInfo(); }); var host = builder.Build(); using var scope = host.Services.CreateScope(); try { var services = scope.ServiceProvider; Application.SetHighDpiMode(HighDpiMode.SystemAware); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); var frm = services.GetRequiredService(); Application.Run(frm); } catch (Exception ex) { Console.WriteLine($"An error has occured: { ex.Message}"); } } } }