Blazor is an open source single-page web application development framework developed by Microsoft. Unlike other frameworks such as Angular, React and Vue which depend on JavaScript libraries, Blazor allows you to write and run C## code in web browsers via WebAssembly. In this blog, we will discuss about the different hosting models in Blazor.

Hosting models

Blazor currently has three hosting models:

  • Blazor WebAssembly (client side).
  • Blazor Server (server side).
  • ASP.NET Core.

Microsoft launched the Blazor server-side hosting model in September 2019 and WebAssembly model in May 2020.

Let’s have a quick look at each model and discuss how each one is different.

Blazor WebAssembly (Client Side)

According to  Microsoft’s official documentation , a client-side Blazor WebAssembly (Wasm) application runs in the browser. When a user opens a web page or web application, all the code related to the client-side logic will be downloaded. This means that all the dependencies will also be downloaded. So, the necessary execution time will be relative to run the application. Once we download everything, if we were to disconnect there would be no problem. Since the Blazor WebAssembly hosting model allows us to continue using the application in offline mode and we can synchronize the changes later.

Structure of Blazor WebAssembly (Client Side)Structure of Blazor WebAssembly (Client Side)

#blazor #hosting models #webassembly

3 Different Hosting Models in Blazor
1.45 GEEK