From bfcfa4ee9b8931b2d8c277ff452cd1722c28d1d4 Mon Sep 17 00:00:00 2001 From: Falcon <12919280+falconfly@user.noreply.gitee.com> Date: Wed, 21 Oct 2026 15:42:31 +0800 Subject: [PATCH] =?UTF-8?q?BuildServiceProviderWithSelf=E6=97=A0=E7=94=A8?= =?UTF-8?q?=EF=BC=8C=E6=94=B9=E7=94=A8=E5=8E=9F=E7=94=9F=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PrivateBox/Program.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PrivateBox/Program.cs b/PrivateBox/Program.cs index ad96f72..c5e7ade 100644 --- a/PrivateBox/Program.cs +++ b/PrivateBox/Program.cs @@ -21,9 +21,9 @@ namespace PrivateBox services.AddSingleton(appConfig); services.AddSingleton(); AddServices(services,appConfig); - using var providerScope = services.BuildServiceProviderWithSelf().CreateScope(); + using var providerScope = services.BuildServiceProvider().CreateScope(); var sp = providerScope.ServiceProvider; - var logger = sp.GetRequiredService().CreateLogger("PrivateBoxMain"); + var logger = sp.GetRequiredService().CreateLogger("Main"); var mainForm = sp.GetRequiredService(); logger.LogInformation($"Application will run main:{mainForm.GetType().FullName}"); Application.Run(mainForm);