ASP.NET Core | Generic Host and Web Host
The host setup the server, request pipeline and responsible for app startup and lifetime management. There are two hosts:
ASP.NET Core Web host is only used for backwards compatibility.
- .NET Generic Host
- ASP.NET Core Web Host
ASP.NET Core Web host is only used for backwards compatibility.
// Host creation
public class Program
{
public static void Main(string[] args)
{
CreateWebHostBuilder(args).Build().Run();
}
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup();
}
Comments
Post a Comment