受欢迎的博客标签

Server-side Blazor runs on the server via SignalR

Client-side Blazor runs client-side on WebAssembly

Blazor WebAssembly Blazor Server
  • Hosts components in the browser using a WebAssembly based .NET Runtime
  • Handles UI updates on the client-side completely
  • Uses open web standard for WebAssembly to run the code - no plugins or transpilation required
  • Can use programming language of choice on server
  • Best for high fidelity, instant update applications like games or drawing apps
  • Requires modern browsers (of which all support WebAssembly) to run
  • Still in preview and under active development
  • Hosts UI components on the server
  • Allows you to take full advantage of .NET Core on the server
  • Uses SignalR to push UI updates for specific components
  • Has the full performance and security that comes with .NET Core
  • Can continue to use familiar ASP.NET Core technologies on the server, side by side
  • Works best when you know the client can maintain a connection to the server
  • Ideal for use on low powered client devices, since components do most of their work on the server
  • Generally available with the release of .NET Core 3.0

Blazor WebAssembly

step 1: install the latest .NET  SDK

https://dotnet.microsoft.com/download/dotnet/5.0

step 2:install the latest Blazor WebAssembly template:

dotnet new -i Microsoft.AspNetCore.Components.WebAssembly.Templates::3.2.0-rc1.20223.4

step 3:installing the latest preview of Visual Studio 2019 

https://visualstudio.microsoft.com/en/vs/preview