Improve Blazor Hosting Models article SEO (#24878)
parent
173b874014
commit
f02b2ccc9a
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
title: ASP.NET Core Blazor hosting models
|
||||
author: guardrex
|
||||
description: Understand Blazor WebAssembly and Blazor Server hosting models.
|
||||
description: Understand Blazor Server versus Blazor WebAssembly (WASM) and which hosting model you should use.
|
||||
monikerRange: '>= aspnetcore-3.1'
|
||||
ms.author: riande
|
||||
ms.custom: mvc
|
||||
|
@ -11,7 +11,9 @@ uid: blazor/hosting-models
|
|||
---
|
||||
# ASP.NET Core Blazor hosting models
|
||||
|
||||
Blazor is a web framework designed to run server-side in ASP.NET Core (*Blazor Server*) or client-side in the browser on a [WebAssembly](https://webassembly.org/)-based .NET runtime (*Blazor WebAssembly*). Regardless of the hosting model, the app and component models *are the same*.
|
||||
Blazor is a web framework designed to run server-side in ASP.NET Core (*Blazor Server*) versus client-side in the browser on a [WebAssembly](https://webassembly.org/)-based .NET runtime (*Blazor WebAssembly*, *Blazor WASM*). Regardless of the hosting model, the app and component models *are the same*.
|
||||
|
||||
This article describes Blazor's hosting models and helps you decide which hosting model to select: *Should I use Blazor Server or Blazor WebAssembly (WASM)?*
|
||||
|
||||
## Blazor Server
|
||||
|
||||
|
@ -42,7 +44,7 @@ We recommend using the [Azure SignalR Service](/azure/azure-signalr) for Blazor
|
|||
|
||||
## Blazor WebAssembly
|
||||
|
||||
Blazor WebAssembly apps run client-side in the browser on a WebAssembly-based .NET runtime. 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 WebAssembly (WASM) apps run client-side in the browser on a WebAssembly-based .NET runtime. 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 WebAssembly: The Blazor app runs on a UI thread inside the browser.](~/blazor/hosting-models/_static/blazor-webassembly.png)
|
||||
|
||||
|
@ -55,7 +57,7 @@ The `blazor.webassembly.js` script is provided by the framework and handles:
|
|||
* Downloading the .NET runtime, the app, and the app's dependencies.
|
||||
* Initialization of the runtime to run the app.
|
||||
|
||||
The Blazor WebAssembly hosting model offers several benefits:
|
||||
The Blazor WebAssembly (WASM) hosting model offers several benefits:
|
||||
|
||||
* There's no .NET server-side dependency after the app is downloaded from the server, so the app remains functional if the client goes offline.
|
||||
* Client resources and capabilities are fully leveraged.
|
||||
|
@ -86,11 +88,11 @@ Blazor WebAssembly includes support for trimming unused code from .NET Core fram
|
|||
|
||||
:::moniker-end
|
||||
|
||||
## Hosting model selection
|
||||
## Should I use Blazor Server or Blazor WebAssembly (WASM)?
|
||||
|
||||
Choice of the Blazor hosting model is an early consideration for Blazor app development. The following table shows the primary considerations for selecting the hosting model.
|
||||
Select the Blazor hosting model for app development based on the desired features and specifications for the app. The following table shows the primary considerations for selecting the hosting model to help you decide which one you should use.
|
||||
|
||||
| | Blazor Server | Blazor WebAssembly |
|
||||
| Feature | Blazor Server | Blazor WebAssembly (WASM) |
|
||||
| --- | :---: | :---: |
|
||||
| Complete .NET Core API compatibility | ✔️ | ❌ |
|
||||
| Direct access to server sources | ✔️ | ❌ |
|
||||
|
@ -102,6 +104,8 @@ Choice of the Blazor hosting model is an early consideration for Blazor app deve
|
|||
|
||||
†Blazor WebAssembly apps can use server-hosted APIs to access functionality that must be kept private and secure.
|
||||
|
||||
After you choose the app's hosting model, you can generate an app from a Blazor project template to begin development. For more information, see [Blazor template options](xref:blazor/tooling#blazor-template-options) in the *Tooling* article.
|
||||
|
||||
## Additional resources
|
||||
|
||||
* <xref:blazor/tooling>
|
||||
|
|
Loading…
Reference in New Issue