Advertisement
Beginner ASP.NET Core, Blazor Integration with ASP.NET Core

How does Blazor integrate with ASP.NET Core's hosting model, and what are the two primary interactive render modes?

Short answer

Blazor runs on top of the same ASP.NET Core hosting infrastructure (Kestrel, middleware pipeline, DI container) as any other ASP.NET Core app.

Save ASP.NET Core mock interview
Advertisement
AModel answer
Blazor runs on top of the same ASP.NET Core hosting infrastructure (Kestrel, middleware pipeline, DI container) as any other ASP.NET Core app. Interactive Server mode executes component logic on the server, communicating UI updates to the browser over a persistent SignalR connection; Interactive WebAssembly mode downloads the .NET runtime to the browser and executes component logic entirely client-side, with no ongoing server connection required for UI interactivity.
// Program.cs
builder.Services.AddRazorComponents()
    .AddInteractiveServerComponents()
    .AddInteractiveWebAssemblyComponents();

app.MapRazorComponents<App>()
    .AddInteractiveServerRenderMode()
    .AddInteractiveWebAssemblyRenderMode();
Real-world example
An internal admin dashboard chooses Interactive Server mode for its fast initial load and simpler debugging on a reliable corporate network, while a public marketing site with occasional interactive widgets uses WebAssembly for those specific components.
Likely follow-ups
  • What is the newer Interactive Auto render mode, and how does it combine both approaches?
  • How does Blazor share the same middleware pipeline as MVC controllers in the same app?
Related topics