maui icon indicating copy to clipboard operation
maui copied to clipboard

Spaces in static files (CSS, JS, images, etc.) not working in MAUI Blazor for Windows

Open VolkumDev opened this issue 3 years ago • 4 comments
trafficstars

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:

imagen

imagen

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

  1. Create a project with the MAUI Blazor template
  2. 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

VolkumDev avatar Aug 04 '22 02:08 VolkumDev

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.

Eilon avatar Aug 26 '22 00:08 Eilon

The repro is actually quite simple: dotnet new maui-blazor -o "Test With Spaces" and you get this broken app:

image

Eilon avatar Aug 26 '22 00:08 Eilon

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.

TCNOco avatar Sep 10 '22 16:09 TCNOco

@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.

Eilon avatar Sep 11 '22 22:09 Eilon

This is a dupe of https://github.com/dotnet/maui/issues/10780

mkArtakMSFT avatar Nov 16 '22 18:11 mkArtakMSFT