© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
2 replies
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();
});
//...
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
/panel
results in the following:
An unhandled exception has occurred while executing the request.
System.InvalidOperationException: Unable to find the provided template 'panel/'
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
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ Blazor vs Razor Pages
C#CC# / help
3y ago
✅ Blazor or Razor pages
C#CC# / help
3y ago
Trying to add Blazor Server to an `Area` in an existing Razor Pages app
C#CC# / help
14mo ago
Adding Identity Core to an existing project
C#CC# / help
2y ago