Check out the Migrate from ASP.NET Core 7.0 to 8.0: Convert a Blazor Server app into a Blazor Web App doc.
Especially 4th point:
Move the content in the _Host page (Pages/_Host.cshtml) to the empty App.razor file. Proceed to make the following changes to the App component.
...
Remove the following lines:
- <environment include="Staging,Production">
- An error has occurred. This application may no longer respond until reloaded.
- </environment>
- <environment include="Development">
- An unhandled exception has occurred. See browser dev tools for details.
- </environment>
Replace the preceding lines with the following:
@if (Env.IsDevelopment())
{
<text>
An unhandled exception has occurred. See browser dev tools for details.
</text>
}
else
{
<text>
An error has occurred. This app may no longer respond until reloaded.
</text>
}
...
So in your case it can look like:
@inject IHostEnvironment Env
@if (Env.IsDevelopment())
{
<base href="/SomePath/" />
}
else
{
<base href="/" />
}