dotnet / dotnet/maui

[MAUI Blazor] Decide whether to support host pages located outside the content directory root

Open
#11,541 3 comments 14 reactions 0 assignees View on GitHub
area-blazor partner/cat 😻 t/docs 📝 t/enhancement ☀️
Dominant language
C#
Stars
23.3k
Forks
2k
Avg merge
1d 15h
Merged PRs (30d)
290

Description

MAUI Blazor uses the location of the host page (usually `index.html`) to determine where the root of the content directory is: https://github.com/dotnet/maui/blob/5105c37657b6be602e76988631cc159687cf4be9/src/BlazorWebView/src/Maui/Windows/BlazorWebViewHandler.Windows.cs#L59-L62

Currently, using a host page located in an RCL or a subdirectory of `wwwroot/` causes static content requests to 404. This can be partially worked around by changing URLs to be relative to the host page location, but this obviously only works for URLs that can be expressed as such.

We could either:
* Keep the existing behavior:
1. Document that the host page should always be placed directly in `wwwroot/`
2. Consider providing better errors/warnings when attempting to do otherwise
* Add new APIs to allow manually specifying the root of the content directory

Related:
https://github.com/dotnet/maui/issues/8613

Contributor guide

Open the contributing guide

Research direction

Start by reading src/BlazorWebView/src/Maui/Windows/BlazorWebViewHandler.Windows.cs at lines 59–62 and the related issue #8613. Determine whether MAUI should retain the wwwroot restriction or expose an API for a custom content root. Done means the chosen behavior is implemented or documented, with appropriate warnings or API guidance.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
mobile-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.