Trigger background service ExecuteAsync method in .Net core console application
问题 I am creating console application in asp.net core which is going to run as background service in different environments. I have used " BackgroundService " class provided by " Microsoft.Extensions.Hosting ". I want to run its " ExecuteAsync " method when my program gets started. File: Program.cs public static void Main(string[] args) { var host = new HostBuilder() .ConfigureHostConfiguration(configHost => { }) .ConfigureServices((hostContext, services) => { services.AddHostedService