How do I reference index.html from a razor library in a Maui Blazor app?

Occasional Visitor

I created a .net Maui Blazor app and a Razor Class Library.

I moved the wwwroot folder and its content over to the Razor class library from the Maui Blazor app, because I want to have all my images and other static files in one location so that I can share them with my MAUI Blazor app, and later a Blazor Server app.


How do I now reference that index.html in the Razor class library from the MAUI Blazor app?


Original code in the MAUI Blazor app



    <BlazorWebView HostPage="wwwroot/index.html">...</BlazorWebView>



New code



    <BlazorWebView HostPage="INDEX.HTML FROM RAZOR CLASS LIBRARY WWWROOT??">...</BlazorWebView>




1 Reply

Hi @TimTi2350,

Thanks for posting your issue here.

However this platform is used for how-to discussions and sharing best practices for building any app with .NET.Since your issue is a technical question, welcome to post it in Microsoft Q&A forum, the support team and communities on Microsoft Q&A will help you for any technical questions.
Besides, it will be appreciated if you can share it here once you post this technical question Microsoft Q&A.
Best Regards,
Lan Huang