Search code examples
.netblazormauiavaloniauiblazor-hybrid

MAUI multiple platform support


I would like to upgrade some desktop apps to use the latest .net technology to support multiple platforms. After some research, I know my choices are MAUI and Avalonia. Here are my findings:

  • Both use XAML
  • MAUI can create native desktop, ios, android app only.
  • Avalonia can create desktop, ios, android, linux and web(WebAssembly) app because it use its own renderer and so the UI will be the same on each platform
  • Since Avalonia app are not native, the app may not fully take advantage of each platform
  • Avalonia is not from Microsoft.
  • Microsoft has Blazor which uses razor and c# in html, mainly for web development. To run Blazor web app in desktop(Blazor-hybrid app), you need to host it in in a WebView desktop component.

For my goal of development of mainly a desktop app, I love the idea of Avalonia because using a single codebase, it produces apps for desktop, mobile and web platforms. However, I am worrying about the supports of the framework in long term. I cannot invest on a framework with an unknown future. I wonder if there is any plan from Microsoft or existing compiler/renderer to let MAUI able to produce a webassembly app? As I see Microsoft is putting a lot effort in the Blazor-hybrid app development, is Microsoft hopes we use Blazor(razor+c#) over XAML? Any idea or suggestion is appreciated.

Updated(230828). MAUI can now support using razor syntax. https://www.youtube.com/watch?v=WeDw37VNF8Y Will Microsoft make desktop and mobile apps the same codebase with Blazor?


Solution

  • MAUI can create native desktop, ios, android app only. Avalonia can create desktop, ios, android, linux and web(WebAssembly) app because it use its own renderer and so the UI will be the same on each platform

    Not quite. MAUI can build for MAC too, and if you really want wasm, Blazor is there to cover that too.

    Since Avalonia app are not native, the app may not fully take advantage of each platform

    MAUI apps are not that great for native development as well. You will have to write a lot of platform specific code. And a lot of #ifdefs. If native capabilities are your main target, then go native, do not go MAUI.

    Avalonia is not from Microsoft.

    MAUI being from MSFT does not mean anything. This platform was released (and still is) bug infested. And relies not on MSFT, but the combined community efforts to make it working somehow. (Yes, somehow. Xamarin déjà vu anyone?) Can you say "5000 open issues"?

    However, I am worrying about the supports of the framework in long term.

    You never know. Let's not forget the "technology of the future" (aka Silverlight) that was promoted as the real deal, and ended up being 3 day miracle. (One of the many techs, along with Windows Mobile, that I want to crack my head open to forget...)

    There is no right decision here. I go with MAUI, because right now it makes me "spam" projects. If you think Avalonia will let you develop faster and easier, please go with it.