-
-
Notifications
You must be signed in to change notification settings - Fork 533
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
_content/Blazorise/ resources give 404 when you have a different base path #3431
Comments
Looks like I have some updates to do. This was an older project that I'm coming back to and updating, and looks like there are some changes from releast 9.5 that i need to do. https://blazorise.com/news/release-notes/095 |
Ok, I followed the steps in the upgrade release notes, but i see no mention of the .css files, which are still causing problems for me, so I'm reopening this issue. I'm seeing some other errors after the update too:
I also confirmed that with the updated libraries, if i remove the code to map everything to |
@stsrki yes I looked through those two tickets before. They didn't provide much info on what I might be doing wrong, as it seems those were about a bug within Blazorise, which seemed to have been resolved with version 9.5.1, i'm on 9.5.5. It seems that it's still rendering these files to the root rather than the new base path. e.g.: Is there any reference repository / sample project that has this working that I could look at to compare to what I'm doing to see where I'm going wrong? |
We had similar problem recently reported in discord channel. @David-Moreira wrote this solution.
|
It looks like that has fixed my issue. So here's my working code: startup.cs: app.UseBlazorFrameworkFiles("/audit");
app.UseStaticFiles(); //include static files for non- /audit directory
app.UseStaticFiles("/audit"); //include static files for /audit directory I am NOT setting app.UseEndpoints(endpoints =>
{
endpoints.MapRazorPages();
endpoints.MapControllers();
endpoints.MapFallbackToFile("/audit/index.html");
}); I also had to change some references in my code to use thanks @stsrki !! |
On my server, it looks like it's rendering the files to |
It seems like you are placing the application inside an audit folder instead of being in the server's app root folder? Are you not? You should be able to put your app at the root folder and then just configure the routing how you want it programmatically. But yea Microsoft docs are the way to go. If you need more concrete help, it's always easier to provide us with a repository so we can actually help you with your particular case. |
Hi, @DrLeh do you still experience the issue? If yes, provide us with a project to reproduce it as it really helps us track the problem. |
No, I am not having this problem any more. Here are some companion issues I'm experiencing that do not seem to be blazorise-specific |
Thanks for letting us know! |
I'm following the steps here to configure my app to run under a different base path, because in our deployed app we will need it to be in a different path than the root of the domain. https://stackoverflow.com/questions/66862350/how-to-change-the-base-url-of-a-blazor-wasm-app . I have my blazor pages in project
Audit.Web
and i'm referencing them inAudit.Web.Api
to render the blazor page on theWeb.Api
site.And then in my index.html setting this:
<base href="/audit/" />
.And mapping it in my
Audit.Web.Api
startup.cs:So now when I run my
Audit.Web.Api
project, I run it and go to the/audit/
page, it will load blazor and show some basic components such as a non-blazorise Button. But the Blazorise paths are returning 404 which fails other components on the pagetrying to navigate directly to the css path without /audit/ still returns 404.
How do I configure the base path for Blazorise so that these paths will work? A similar line in the index.html file for the blazor js seems to work fine:
but these don't
The text was updated successfully, but these errors were encountered: