maui
maui copied to clipboard
Spaces in static files (CSS, JS, images, etc.) not working in MAUI Blazor for Windows
Description
The problem is almost identical to #8103. I create a project based on the MAUI Blazor Template, i run the app, and what i get is this:


I have already cleaned the solution, deleted the obj/bin folders, i did it on different orders, i rebuild, clean rebuild, etc. Nothing worked.
No errors are showing up on Visual Studio.
I have the latest available Visual Studio Preview version from "Tools and Features" installer.
Steps to Reproduce
- Create a project with the MAUI Blazor template
- Build and run the project.
Version with bug
6.0.400
Last version that worked well
Unknown/Other
Affected platforms
Windows, Android
Affected platform versions
Windows 10.0.19041.0
Did you find any workaround?
No response
Relevant log output
No response
More repro info here: https://github.com/dotnet/maui/issues/9481. Per the other issue, we likely need to do some UrlDecode on the "URL"-ish path to fix up spaces and perhaps other path-unfriendly characters.
The repro is actually quite simple: dotnet new maui-blazor -o "Test With Spaces" and you get this broken app:

Just to be clear, the normal Blazor server has absolutely no issue handling %20. It seems to only be MAUI Blazor. A little annoying to change how my programs work to get around this (swap ' ' with '_' for example, and rename all the files) but not the end of the world.
@TcNobo , yup, this bug is entirely specific to Blazor Hybrid. It needs to un-escape data that comes from the native webview (e.g. WebView2) so that it can use that as a file system path.
This is a dupe of https://github.com/dotnet/maui/issues/10780