C#C
C#17mo ago
Angius

Adding Blazor to an existing Razor Pages project

I decided that messing around with SSR and JS for the admin panel is not worth the hassle and I'll just make it with Blazor. I don't care about the bundle size, I don't care about SignalR connections, seems to be a perfect fit.

I think I did everything correctly, but I'm still getting errors out the wazoo.
//...
services.AddRazorComponents().AddInteractiveServerComponents();
//...
app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();
app.UseBanMiddleware();
app.UseAntiforgery();
app.UseEndpoints(endpoints => {
    endpoints.MapRazorPages();
    endpoints.MapControllers();
    endpoints.MapOgma3Endpoints();
    endpoints.MapGroup("panel")
        .MapRazorComponents<App>()
        .AddInteractiveServerRenderMode();
});

but going to /panel results in the following:
An unhandled exception has occurred while executing the request.
System.InvalidOperationException: Unable to find the provided template 'panel/'

With the whole log being https://pastie.io/bcixjg.yml
Was this page helpful?