Skip to content

Blazor Unified Web App Core 8 : base href not working properly when properly configured #64303

@vsfeedback

Description

@vsfeedback

This issue has been moved from a ticket on Developer Community.


[severity:It’s more difficult to complete my work]
in Blazor Unified Web App, let’s suppose your web sit under a subdirectory, then you need to set many things (hope Microsoft could simplify that in a next version.
So Currently, my app sit in https://prototypeomega.ca/Allergy
because it need to be under a subdirectory (Allergy) here the settings we need to set

In App.Razor:
<base href=“/Allergy/” />

In Program.cs:
app.UsePathBase(“/Allergy”);

In launchSettings.json (for Local run):
add “launchUrl”: “Allergy/”
to http, https and IIS Express

now, if you’re using Identity, Account/Page/manage/index.razor will crash upon opening.
You need to change the @page from @page “/Account/Manage” to @page “/Allergy/Account/Manage”
All other page will work BUT, if you press F5 on a page, it will also crash just like Manage/index.
you’ll need to also add the prefix /Allergy to all your page.
Furthermore, if you REMOVE the base page (without the Allergy) it will not work.
This is a bug because there should be only 1 page directive.

The bug in action can be seen in the video I made.
[https://youtu.be/aV8_y7MehGQ](Youtube Video Showing the bug in action)


Original Comments

Feedback Bot on 11/10/2025, 03:17 AM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

Patrice Charbonneau on 11/11/2025, 02:18 AM:

(private comment, text removed)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Author: Migration Bot 🤖The issue was created by a issue mover bot. The author may not be the actual author.Needs: Attention 👋This issue needs the attention of a contributor, typically because the OP has provided an update.Needs: ReproIndicates that the team needs a repro project to continue the investigation on this issuearea-blazorIncludes: Blazor, Razor Components

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions