New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blazor has case sensitive URLs when hosted in a Child Directory #1776

Closed
RodDaSilva opened this Issue Jan 17, 2019 · 1 comment

Comments

Projects
None yet
3 participants
@RodDaSilva
Copy link

RodDaSilva commented Jan 17, 2019

(NOTE: this report is in the context of "server-side" Blazor app hosting)

It is possible to host Blazor in a child directory by:

  1. Adding an app.Map() in the Startup.Configure() method of the host:

app.Map("/dashboard", child => { child.UseServerSideBlazor<DiskBounty.Dashboard.Startup>(); });

and

  1. Changing the base href in the index.html of the Blazor App:

    base hef="/dashboard/"

However, if you do this you can only use the casing of the base href to access your Blazor pages. For example /dashboard/counter and /dashboard/Counter will work but /Dashboard/counter will not. That is you must always specify 'dashboard' (in this example) within the URL in lower case. This is a behavior difference to when the Blazor app is hosted in the root directory, where all urls are case insensitive.

The error you get is:

warn: Microsoft.AspNetCore.Blazor.Server.BlazorHub[0]
Unhandled Server-Side exception
System.AggregateException: One or more errors occurred. (Error: No element is currently associated with component 1) ---> Microsoft.AspNetCore.Blazor.Browser.Rendering.RemoteRendererException: Error: No element is currently associated with component 1
--- End of inner exception stack trace ---

@Lupusa87

This comment has been minimized.

Copy link

Lupusa87 commented Jan 17, 2019

You need to open this issue here https://github.com/aspnet/AspNetCore because blazor repo moved to AspNetCore

@rynowak rynowak closed this Jan 22, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment