I am trying my hands on blazor.Net which is an experimental framework.
I already developed a small project in this Framework and its awesome.
But after recent update in Blazor Language Service on 14 November I am seeing two options in Template selection.
First is Blazor (ASP.NET Core Hosted)
Second is Blazor (Server Side in ASP.NET Core)
There is no information about difference between them,
Can anybody tell me what is difference between these two templates and when should choose which one?
Blazor is a web framework for building web UI components (Razor components) that can be hosted in different ways. Razor components can run server-side in ASP.NET Core (Blazor Server) versus client-side in the browser on a WebAssembly-based . NET runtime (Blazor WebAssembly, Blazor WASM).
The main architectural difference is that ASP.NET Web Forms runs only on the server. Blazor can run on the client in the browser.
The Blazor Server hosting model offers several benefits: Download size is significantly smaller than a Blazor WebAssembly app, and the app loads much faster. -The app takes full advantage of server capabilities, including the use of . NET Core APIs.
A Blazor app actually is a SPA. But the main difference to other frameworks is, that Blazor lets you control both the client and server side with C# code. To show that benefit, let's look at other SPA frameworks like Angular: You can build an Angular SPA with ASP.NET Core.
I think the accepted answer does not answer the question asked like Mike-EEE mentioned in one of the comments.
The necessary information can be found under this link: https://www.telerik.com/blogs/a-breakdown-of-blazor-project-types
The Blazor Full-Stack template encompasses the same project structure as the Client-Side template with a few additions. Just like the Client-Side template there is no HTML rendered by the server and all files are delivered to the client as static files including .NET binaries. The difference however is added ASP.NET Core hosting and Web API and a Shared project for common application logic.
The template includes three projects: a Client-Side Blazor application Blazor.Client, an ASP.NET Core server application Blazor.Server, and a shared .NET Standard project for common application logic Blazor.Shared.
The Blazor Server-Side project template takes a significantly different approach to how a Blazor application is delivered and interacts with the browser. When using the server-side configuration Blazor utilizes the browser as a "thin-client" by deploying a SignalR JavaScript application to the client. On the server, Blazor implements a SignalR hub communicating with the client via web sockets. In the server-side hosting model, Blazor is executed on the server from within an ASP.NET Core app. UI updates, event handling, and JavaScript calls are handled over the SignalR connection. In this configuration there is no need for WebAssembly and Blazor is executed on the ASP.NET Core runtime at the server. All UI updates are sent as diffs, bidirectionally as binary packets over web sockets. To the user, the application is indistinguishable from any other web application.
In the server-side hosting model, Blazor is executed on the server from within an ASP.NET Core app. UI updates, event handling, and JavaScript calls are handled over a SignalR connection.
In the client-side model, the Blazor app, its dependencies, and the .NET runtime are downloaded to the browser, and the app is executed directly on the browser UI thread. All UI updates and event handling happens within the same process.
Pros & cons – read more here.
The server side model was seen as less risky to release first so we will see it first with asp.net 3.0. Client side will come later.
Warning: Do not use in Production code until we get a supported release.
UPDATE
Starting .Net core 3.0, Blazor provides 2 hosting model
https://docs.microsoft.com/en-us/aspnet/core/blazor/hosting-models?view=aspnetcore-3.1
Blazor WebAssembly App
The principal hosting model for Blazor is running client-side in the browser on WebAssembly. The Blazor app, its dependencies, and the .NET runtime are downloaded to the browser. The app is executed directly on the browser UI thread. UI updates and event handling occur within the same process. The app's assets are deployed as static files to a web server or service capable of serving static content to clients.
Blazor Server App
With the Blazor Server hosting model, the app is executed on the server from within an ASP.NET Core app. UI updates, event handling, and JavaScript calls are handled over a SignalR connection.
Note: Blazor Server is supported from ASP.NET Core 3.0 and Blazor WebAssembly was officially released during Microsoft build 2020 from .NET Core 3.1.4
Blazor WebAssembly 3.2.0 now available
Here is article that explains it easily:
Client-Side: (First Blazor template in Template Selection):
In this hosting modal the application is executed client-side in the browser. The Blazor app, its dependencies, and the .NET run-time are downloaded to the browser. The app is executed directly on the browser UI thread. UI updates and event handling occur within the same process. This execution modal is available with a preview version of .Net Core.
ASP.NET Core Hosted (Second Blazor template in Template Selection)
In this hosting modal, the application is executed on the server from within an ASP.NET Core app. UI updates, event handling, and JavaScript calls are handled over a SignalR connection.
Server-side (Third Blazor template in Template Selection) In this hosting modal, the whole application will reside in the ASP.NET Core server and requests will be made from browser to server for various actions. As this does not send any form of DLL to the browser, it is supported by legacy browsers such as IE11.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With