Skip to main content

Explain the ASP.NET Core hosting model (Host Builder, Kestrel, Startup flow).

Mid .NET Core
Quick Answer WebApplication.CreateBuilder() sets up the Generic Host. Builder.Services adds DI registrations. builder.Build() creates the WebApplication. Then middleware is added (app.UseAuthentication(), app.MapControllers(), etc.). app.Run() starts Kestrel listening. In .NET 6+ this is all in Program.cs รขโ‚ฌโ€ no Startup.cs required.

Answer

The hosting model uses a unified Host that configures DI, logging, configuration, server startup, environment settings, and middleware pipeline creation. It initializes Kestrel, loads configuration, builds services, and finally runs the HTTP pipeline.

S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice