Skip to content

Instantly share code, notes, and snippets.

@tnn4
Last active August 22, 2022 00:13
Show Gist options
  • Select an option

  • Save tnn4/5cf7478ae8c9e4b22a40124e1ff29dce to your computer and use it in GitHub Desktop.

Select an option

Save tnn4/5cf7478ae8c9e4b22a40124e1ff29dce to your computer and use it in GitHub Desktop.
.NET web frameworks

.NET web frameworks

ASP.NET (Active Server Pages )

Blazor

Blazor:

  • UI web framework based on .NET
  • .NET based web framework for building UI components(Razor components)
  • compiles to Web-Assembly (wasm)
  • can run on the client via web assembly
  • can run on the server

Razor: markup syntax for .NET

Razor component:

  • .cshtml extension
  • markup(HTML) + logic(C#)

.NET MAUI vs .NET MAUI Blazor?

  • XML with MAUI
  • you can use HTML with the Blazor version

Blazor Hosting Models

Server

  • uses SignalR connection
    • SignalR
    • ASP.NET library
    • allows server to send async notifications to client
    • basically allows easy real-time web functionality
  • pros
    • smaller download sizes for the user, saves bandwidth
  • cons
    • There's no offline support. If the client connection fails, the app stops working.

commands:

  • dotnet new blazorserver

WebAssembly

  • runs on web assembly based browser runtime
  • Blazor app + .NET runtime + dependencies
  • no backend ASP.NET Core app = standalone
  • backend = hosted
  • can be built as PWA(Progressive Web App)
    • PWA
    • uses modern browser APIs

pro:

  • enables native client app capabilities
  • works offline, run in own app window

cons:

  • bigger download sizes for clients

commands:

  • dotnet new blazorwasm

Hybrid

  • app runs in embedded Web View
  • hybrid app = native app + web technology
  • no WebAssembly
  • Razor component + .NET code + HTML/CSS
  • can be built on different .NET native app frameworks
    • .NET MAUI
    • WPF (Windows Presentation Foundation)
    • Windows Form

pros:

  • good for native platforms

cons:

  • have to manage multiple platform-specific app versions
  • no official support

Commands:

  • dotnet workload install maui
  • dotnet new maui-blazor

.NET MAUI (.NET Multi-platform App UI)

  • cross-platform framework for making native mobile and desktop apps with C# and XAML

tags: web, framework, native, mobile, desktop, ASP.NET, .NET, Blazor, Razor, MAUI, WPF, windows forms, WASM, WebAssembly, SignalR

Gist of this:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment