What is the difference between the Generic Host and Web Host in ASP.NET Core?

Junior .NET Core

Answer

Earlier ASP.NET Core versions used WebHost to configure web-specific hosting (Kestrel, IIS integration, MVC, etc.).

The newer Generic Host unifies hosting for all app types (web, background services, workers, gRPC, SignalR) under a single abstraction.

  • Generic Host centralizes DI, configuration, and logging.
  • It supports non-web workloads and multiple hosted services in the same process.
  • For web apps, Generic Host wires in WebHost-like features such as Kestrel and endpoint routing under the hood.

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