Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Add Blazor to an ASP.NET Core 8 project

$
0
0

I have an old project build with in ASP.NET Core 8 using Razor. Now, I want to slowly migrate this project to Blazor. The idea is to add Blazor in the project and migrate one page at the time from Razor pages to Blazor page and Blazor components.

In the Program.cs, I added those lines:

builder.Services.AddSignalR();builder.Services.AddServerSideBlazor();

and then those lines

app.UseBlazorFrameworkFiles();app.MapBlazorHub();

Also, I created a simple page for testing

@page "/Test"<h3>@MyTest</h3>@code {    public string? MyTest = "Hello";}

The application runs but the page Test is not found. If I have a Blazor component, I tried to add it to a page using

<component type="typeof(Counter)" render-mode="WebAssemblyPrerendered" />

but it is not working. How can I add Blazor then?


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>