Skip to content

Maui Blazor fails loading files with spaces in it on Windows #28959

Open
@MarkusRodler

Description

@MarkusRodler

Description

Image
As you can see in the screenshot, the Maui Blazor version fails to load the second image because it has a space in it.
In the lower half of the image the index.html is directly opened and it doesn't fail.
If I make a Blazor Webassembly project it also works properly.

The issue also exists while displaying images from the disk like in the user image folder.

Steps to Reproduce

  1. Create a new project with this secret command: dotnet new maui-blazor
  2. Add these lines to the body of the index.html:
    <img src="dotnet_bot.svg" />
    <img src="dotnet bot.svg" style="float: right; transform: scaleX(-1)" />
  1. Remove this tag in order to display it via file: <base href="/" />
  2. Copy dotnet_bot.svg image to the wwwroot twice. One with at least one space added and tjhe other one with no spaces.
  3. Run it with Maui => Fail
  4. Run it directly with Browser => Success
  5. Run it in an Blazor Webassembly project => Success

Link to public reproduction project repository

https://github.com/MarkusRodler/mauiimagebug

Version with bug

9.0.60 SR6

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

Windows 11 Pro 26100.3775

Did you find any workaround?

No response

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-blazorBlazor Hybrid / Desktop, BlazorWebViewplatform/windows 🪟s/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions