Looking at our Program.cs file, you can see that's exactly what happens: the Main() method only builds our web host, and starts it running with no terminating condition:
public class Program{ public static void Main(string[] args) { CreateWebHostBuilder(args).Build().Run(); } public static IWebHostBuilder CreateWebHostBuilder(string[] args) => WebHost.CreateDefaultBuilder(args) .UseStartup<Startup>();}
The WebHost class is part of the Microsoft.AspNetCore namespace, and its default implementation provides a running Kestrel web server that interacts with your application code using the Startup.cs file provided to the UseStartup<T>() method on the IWebHostBuilder instance you return to your Main() method to be run by your program. ...