Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/danroth27/net8blazorserver
Blazor Server app with .NET 8
https://github.com/danroth27/net8blazorserver
Last synced: about 1 month ago
JSON representation
Blazor Server app with .NET 8
- Host: GitHub
- URL: https://github.com/danroth27/net8blazorserver
- Owner: danroth27
- License: mit
- Created: 2023-06-14T06:24:25.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-26T17:00:05.000Z (about 1 year ago)
- Last Synced: 2024-11-09T03:54:43.358Z (about 2 months ago)
- Language: HTML
- Homepage:
- Size: 190 KB
- Stars: 44
- Watchers: 3
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Blazor Server in .NET 8
This project demonstrates how to upgrade Blazor Server apps to .NET 8 and take advantage of the latest Blazor features.
To upgrade an existing Blazor Server app to .NET 8:
1. Update the project file to target `net8.0` and package references to the latest .NET 8 versions.
1. Move the contents of *App.razor* to *Routes.razor*.
1. Move content from *Pages/_Host.cshtml* to *App.razor*:
1. Update script to *blazor.web.js*.
1. Replace tag helpers with Blazor equivalents.
1. Update *Program.cs*:
1. Replace `AddServerSideBlazor()` with `AddRazorComponents().AddInteractiveServerComponents()`.
1. Add `app.UseAntiforgery()`.
1. Replace `MapBlazorHub()` with `MapRazorComponents().AddInteractiveServerRenderMode()`.
1. Remove `app.MapFallbackToPage("/_Host");`.