Before you migrate to .NET MAUI, IMO

.NET MAUI is the new Xamarin!  With Xamarin losing support May 2024 and .NET MAUI already reaching “generally available” status, you may be wondering if you should be considering an upgrade.  Here is my experience when I looked into this a few months ago.

Let me first tell you, after I saw James Montemagno’s videos on getting started with .NET MAUI, I was sold!  So many cool improvements from Xamarin Forms.

Here are a few of the features that stood out to me:

  • Single project vs a project for each platform
    • Single place for your resources
      • Fonts
      • Images
    • .NET Generic Host
      • Register dependency injection services, logging, etc.
  • A Windows desktop platform target included
    • .NET MAUI supports WinUI – Xamarin supported UWP
  • .NET 6 is integrated with MAUI
  • .NET Hot Reload
  • Graphics API
  • MVVM (community toolkit)
    • Auto-generated code
    • Dependency injection of ViewModels

The main seller to me beyond the end of life of Xamarin was actually the MVVM auto-generated code.  For anyone who’s done MVVM, you know it can be a little tedious in setting up with INotifyPropertyChanged, setting up commands, etc. 

Looking at all these benefits, you may have strong enough reasons to make the move to MAUI.  After all, us developers do love shiny new objects.

My Upgrade Experience

I started down this road in upgrading one of my personal Xamarin projects.  To cut to the chase though, I ended up sadly aborting.  Here is why:

  • Even though .NET MAUI is generally available, I ran into several bugs (which were also logged in github).  A few of them being major issues for me.  I initially just worked around small issues I would find, but as I continued on with the upgrade, the issues piled up and I didn’t have the time to deal with them all.
  • Features or controls you may have been able to use fine in Xamarin may not be easily available in .NET MAUI.  For example, I was using an SVG image control in Xamarin, but there wasn’t an equivalent I could find in MAUI that could load an SVG from an HTTP URL.
  • If you’re using controls from a company such as SyncFusion or Telerik – I would guess at least half of the Xamarin controls are not available as .NET MAUI controls.  You would need to figure out alternatives for ones you do not have a MAUI equivalent for. 

This was a few months ago, so it is possible there have been improvements/ bug fixes since then.  Just know that these are still risks you will take and it might not be worth it to you.

If you are limited on time to spend on doing the actual upgrade, then I would definitely advise to wait for it to be more stable. You’ll be wasting a lot of time figuring out work arounds or troubleshooting whether the issue is your own bug or a .NET MAUI bug.

What types of projects SHOULD do the upgrade?

IMO, I think a project that would be “safe” in doing an upgrade for this right now would probably if …

  • Your app is a very simple “CRUD” application with no fancy UI
  • You have plenty of time to work on it / not worried about a deadline.
    • You have time to wait for bug fixes or have time to write your own workarounds
  • Your app is not business-critical.
    • I would start with a low-risk application to do this upgrade

There is a lot to look forward to with the new features of .NET MAUI, but for your project upgrade it may not be ready yet.  Just like any new technology, it may take a bit to mature as the bugs are worked out.  I hope this article helped give you some insight as you make your decision to make the leap to .NET MAUI.