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?
2