Shared UI using Razor Class Library, RCL, between .net Maui Blazor & Blazor webassembly

Viewed 643

I'm following this demo by D. Roth https://youtu.be/7UM6s0QPvRQ?t=3530 58:50 Demo: Sharing Blazor UI between web and .NET MAUI

I was wondering if "index.html" can also be moved to RCL project and be removed from Blazor maui and blazor webassembly project as it has identical codes in it? unfortunately I haven't been able make it work so far.

Thanks

1 Answers

The index.html for web application has:

<script src="_framework/blazor.**webassembly**.js"></script>

The index.html for MAUI application has:

<script src="_framework/blazor.**webview**.js" autostart="false"></script>

Additionally, for the MAUI application, the CSS and JS files have a different path. For example <link href="**_content/RCL**/css/app.css" rel="stylesheet" />

I recommend you to watch that section of the presentation from D. Roth. You can see these small differences in the video too.

Related