Dependency Injection in ASP.NET Core Worker Service
问题 I'm facing some dependency injection issues in .NET Core Worker Service. Please see the below code in Program.cs file. public static void Main(string[] args) { Log.Logger = new LoggerConfiguration() .MinimumLevel.Debug() .MinimumLevel.Override("Microsof)t", LogEventLevel.Warning) .Enrich.FromLogContext() .WriteTo.File(@"C:\MyApp_Log\Log.txt") .CreateLogger(); try { Log.Information("Starting up the service."); CreateHostBuilder(args).Build().Run(); return; } catch (Exception ex) { Log.Fatal(ex