What is a Web Host?

The Web Host was introduced with the early versions of ASP.NET Core. It is specifically designed for web applications.

Key Points

  1. Built for Web Apps Only: Web Host is tightly coupled with ASP.NET Core MVC or Razor Pages applications.

  2. Uses Kestrel or IIS: It mainly works with Kestrel (a cross-platform web server) or IIS (Windows web server).

  3. Startup.cs Support: The Web Host requires a Startup class where you configure services and the middleware pipeline.

  4. Less Flexible: Since it is web-only, you cannot use it for console apps, worker services, or background jobs.