Use UseMaui=true in a razor component breaks the _content/PackageId
See original GitHub issueDescription
Adding <UseMaui>true</UseMaui>
to a razor component library causes the static we assets not to be packaged correctly.
I think this has to do with the fact our maui blazor targets assume an app and thus force set the BasePath to be /
instead of first checking the context - final app or library,
Steps to Reproduce
- Create a maui blazor app that references a plain razor component library
- Observe a successful run
- Add UseMaui=true to the razor compoent
- Observe that the razor component no longer loads
Expected Behavior
Actual Behavior
Basic Information
- Version with issue:
- Last known good version:
- IDE:
- Platform Target Frameworks:
- iOS:
- Android:
- UWP:
- Android Support Library Version:
- Nuget Packages:
- Affected Devices:
Screenshots
Reproduction Link
Workaround
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Use "Razor component" and avoid "Blazor ...
Description I'm going to move this over from a GH discussion because I'm having good luck thus far getting MS pubs updated on...
Read more >ASP.NET Core Razor component lifecycle
The Razor component processes Razor component lifecycle events in a set of synchronous and asynchronous lifecycle methods. The lifecycle methods ...
Read more >Use Razor components in JavaScript apps and SPA ...
This article covers how to render Razor components from JavaScript, use Blazor custom elements, and generate Angular and React components.
Read more >Auto-formatting in EditForm razor code breaks binding ...
I'm experimenting with EditForm component tag and related Input child tags. The Input tag (e.g. InputText) expect binding with a @bind-Value ...
Read more >Can Blazor component interaction occur inside a Razor ...
Is it possible to use a component to create a dynamic Razor pages form, or does the entire form need to be moved...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The workaround is to:
*.razor
files) in a regular Razor Class Library (RCL)<UseMaui>true</UseMaui>
and reference the RCL for whatever types it needstry only use maui in ios and mac ,
and