C#C
C#3y ago
teauxfu

❔ ✅ How does .NET MAUI Blazor relate to Blazor Server or WebAssembly?

Or am I conflating those ideas? I see the .NET MAUI Blazor project template
index.html
has the line <script src="_framework/blazor.webview.js" autostart="false"></script>. So that tells me it isn't using WebAssembly, right?

I want to write a Blazor app with the intention of using it as a desktop application. I think either PWA via WebAssembly or Blazor inside MAUI as a desktop exe would work. I'm curious if there's some solution layout which would allow building both. The app wouldn't be useful on phones or tablets, so I'm not concerned about those targets. I'm just interested in .NET + xplat desktop UI, without resorting to Electron.

I saw this reddit post in which a comment suggests using a shared project structure where you keep the Blazor project separate, and just reference it from the MAUI "host" if you will. https://www.reddit.com/r/dotnet/comments/pqi891/net_maui_app_vs_net_maui_blazor_app/
I'm interested in pursuing this route, but not sure whether I should have the dedicated Blazor project be a WebAssembly or Server. Or if it even matters at this point and I might as well use a Razor Class Library template.
reddit
22 votes and 15 comments so far on Reddit
Was this page helpful?