Live Chat Icon For mobile
Live Chat Icon

What are all the hosting models available in Blazor? Which Blazor hosting model should I choose and when?

Platform: Blazor| Category: Hosting models

There are two hosting models available in Blazor: Blazor Server and Blazor WebAssembly.

Blazor Server
Server-side Blazor apps are executed on the server within an ASP.NET Core application. All UI updates, JavaScript calls, and event handling are handled from the server using a SignalR connection. On the client side, the blazor.server.js script sets up the SignalR connection with the server. The script is served to the client-side app from an embedded resource in the ASP.NET Core shared framework.

Blazor WebAssembly
Blazor WebAssembly apps are executed on the client-side in the browser. The .NET runtime is downloaded with the app along with the app assembly and any required dependencies, then the application is executed directly from the browser UI thread. The WebAssembly app static assets are loaded as static files to a web server or service capable of serving static content to clients. The blazor.webassembly.js script handles downloading the app, the app’s dependencies, and the .NET runtime. The script file also initializes the runtime to run the app.

Refer to this documentation section to help you choose a Blazor hosting model.

Share with

Share on twitter
Share on facebook
Share on linkedin

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.