Xamarin Versus .NET MAUI
Tags: dotnet, csharp, maui, xamarin
Published: 2022-05-31 11:24:59

---
title: Xamarin Versus .NET MAUI
published: true
date: 2022-05-31 10:00:13 UTC
tags: dotnet, csharp, maui, xamarin
canonical_url: https://www.syncfusion.com/blogs/post/xamarin-versus-net-maui.aspx
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pjfq41n8mkv7xw4a2i61.png
---

I hope you are all now familiar with these two names, [Xamarin.Forms](https://dotnet.microsoft.com/en-us/apps/xamarin "Xamarin.Forms") and [.NET MAUI](https://dotnet.microsoft.com/en-us/apps/maui ".NET MAUI"), especially if you are going to develop cross-platform apps. When trying to choose one or the other, some of you might be uncertain.

In this blog, I will try to help you better understand the differences between Xamarin.Forms and .NET MAUI.

## Xamarin.Forms: Overview

Xamarin.Forms is generally used to develop native cross-platform apps. Basically, Xamarin.Forms is a layer of abstraction that allows interaction of the shared code with the underlying platform code of Android, iOS, and Windows.

Using Xamarin.Forms, a cross-platform mobile app developer can save development time by writing all of their business logic in a single language. Almost 90% of the code required to develop an app is shared across platforms, letting you achieve native performance and the same look on each.

## .NET MAUI: Overview

As you know, the .NET Multi-platform App UI is popularly known as .NET MAUI. It is used to build native cross-platform apps with .NET for Android, iOS, macOS, and Windows. .NET MAUI is built on top of Xamarin.Forms, evolving the platform to the next level.

With .NET MAUI, Microsoft begins a journey to create a unified .NET platform as a single base class for .NET Core and Mono/Xamarin together.

## Commonalities

Since .NET MAUI is an evolution of Xamarin.Forms, they have most of their features in common. You can get almost all things in .NET MAUI that Xamarin has, like controls, layouts, Shell, gestures, templates, and cross-platform APIs for device features. You can find all these in .NET MAUI with a different namespace.

## Xamarin versus .NET MAUI

Even though there are many things in common between Xamarin.Forms and .NET MAUI, there are a lot of differences, too. I will spend the rest of this blog discussing the main 15 differences.

### 1. Platform Architecture

First and foremost, the main change in platform architecture is that .NET MAUI is integrated with .NET 6.0 to be a part of the  **<u><a title="The Journey to One .NET: YouTube Video" href="https://www.youtube.com/watch?v=ctSqiD8BGPM">Journey to One .NET</a></u>**.

<table width="100%">
<tbody>
<tr>
<td style="width: 50.3466%;" width="50%">Xamarin</td>
<td style="width: 49.6534%;" width="50%">.NET MAUI</td>
</tr>
<tr>
<td style="width: 50.3466%;" width="50%">

<img class="wp-image-100033 " src="https://www.syncfusion.com/blogs/wp-content/uploads/2022/05/Xamarin.Forms-Architecture.png" alt="Xamarin.Forms Architecture" width="328" height="190" /> <figcaption>Xamarin.Forms Architecture</figcaption></td>
<td style="width: 49.6534%;" width="50%">

<img class="wp-image-100034 " src="https://www.syncfusion.com/blogs/wp-content/uploads/2022/05/NET-MAUI-Architecture.png" alt=".NET MAUI Architecture" width="328" height="190" /> <figcaption>.NET MAUI Architecture</figcaption></td>
</tr>
</tbody>
</table>

### 2. Project Structure

The main difference between Xamarin.Forms and .NET MAUI starts with their project structure.

<table style="height: 296px;" width="100%">
<tbody>
<tr style="height: 24px;">
<td style="height: 24px;" width="50%">Xamarin</td>
<td style="height: 24px;" width="50%">.NET MAUI</td>
</tr>
<tr>
<td>Uses separate projects for each platform.</td>
<td>Single project structure: each platform can be targeted using devices about to be deployed.</td>
</tr>
<tr>
<td>Platform-dependent files and code are maintained under different projects.</td>
<td>The platform-dependent files and code are maintained under<a title="Configure multi-targeting in .NET MAUI" href="https://docs.microsoft.com/en-us/dotnet/maui/platform-integration/configure-multi-targeting"> platform folders and platform filename targets</a> such as MainPage.android.cs and MainPage.iOS.cs.</td>
</tr>
<tr>
<td>Project system: <strong>Franken-proj</strong>.</td>
<td>Project system: <strong>SDK Style</strong>.</td>
</tr>
</tbody>
</table>

With Xamarin.Forms, developers may become frustrated working with multiple projects targeting multiple platforms; keeping images, fonts, and platform-related code organized; adding different dependencies, and resolving them if they’re referenced as NuGet packages. Encountering these problems, developers are now addressed in .NET MAUI with a single project.

Since .NET MAUI is a simple project app, it works on a multitarget-based structure. A .NET MAUI app contains a **Platforms** folder, with subfolders representing platforms such as Android, iOS Maccatalyst, and Windows to target platform-specific code that starts the app on platforms. It can also be multitargeted based on your own file name. Generally, the file name target pattern is to include the platform as an extension in the file name. For example:

- MainPage.android.cs targeting Android
- MainPage.iOS.cs targeting iOS and Mac
- MainPage.Windows.cs targeting Windows

### 3. Supported Platforms and Versions

The main difference in platform support between Xamarin and .NET MAUI is in their support for Windows. Xamarin supports UWP, whereas .NET MAUI supports WinUI. Have a look at the following table for support version details.

<table>
<tbody>
<tr>
<td>Xamarin</td>
<td>.NET MAUI</td>
</tr>
<tr>
<td><strong>Primary support</strong>
<ul>
 	<li>Android 4.4 (API 19) or higher (<a title="Android platform support" href="https://docs.microsoft.com/en-us/xamarin/get-started/supported-platforms#android-platform-support">more details</a>).</li>
 	<li>iOS 9 or higher.</li>
 	<li>UWP: Windows 10, build 10.0.16299.0 or greater for .NET Standard 2.0 support.</li>
</ul>
</td>
<td><strong>Primary support</strong>
<ul>
 	<li>Android 5.0 (API 21) or higher.</li>
 	<li>iOS 10 or higher.</li>
 	<li>macOS 10.13 or higher</li>
 	<li>WinUI: Windows 11 and Windows 10 version 1809 or higher</li>
</ul>
</td>
</tr>
<tr>
<td><strong>Additional platform support</strong>
<ul>
 	<li>Samsung Tizen</li>
 	<li>macOS 10.13 or higher</li>
 	<li>GTK#</li>
 	<li>WPF</li>
</ul>
</td>
<td><strong>Additional platform support</strong>
<ul>
 	<li>Tizen, supported by Samsung.</li>
 	<li>Linux, supported by the community.</li>
</ul>
</td>
</tr>
</tbody>
</table>

### 4. .NET CLI

Another major difference is that .NET MAUI runs on .NET CLI. The[.NET command-line interface (CLI)](https://docs.microsoft.com/en-us/dotnet/core/tools/ ".NET CLI overview") is a cross-platform toolchain for developing, building, running, and publishing .NET apps. This .NET CLI provides .NET MAUI apps with a seamless build and run experience.

<table width="100%">
<tbody>
<tr>
<td width="50%">Xamarin</td>
<td width="50%">.NET MAUI</td>
</tr>
<tr>
<td width="50%">Xamarin supports .NET Framework to build and run apps.</td>
<td width="50%">.NET MAUI supports the .NET CLI toolchain to build, run, and publish .NET apps.</td>
</tr>
</tbody>
</table>

### 5. Renderer and Handler Architectures

In Xamarin, controls are made with renderers. When developers want to customize a native controls’ UI, they must use a custom renderer to do so. These renderers cost the users heavily in terms of performance and app size.

But .NET MAUI uses handler architecture that is very loosely coupled with native assembly. With a native platform, this results in a lightweight app with better performance.

You can use renderers here if needed. You can reuse Xamarin.Forms custom renderer when porting.

<table style="height: 307px;" width="547">
<tbody>
<tr>
<td style="width: 347px;">Xamarin</td>
<td style="width: 351px;">.NET MAUI</td>
</tr>
<tr>
<td style="width: 347px;">Uses renderer architecture.</td>
<td style="width: 351px;">Uses <a title="Blog: Customize .NET MAUI Controls with Handler Architecture" href="https://www.syncfusion.com/blogs/post/how-to-customize-net-maui-controls-with-handler-architecture.aspx">handler architecture</a>.</td>
</tr>
<tr>
<td style="width: 347px;">Tightly coupled with native controls.</td>
<td style="width: 351px;">Loosely coupled with native controls.</td>
</tr>
<tr>
<td style="width: 347px;">You cannot use handlers here.</td>
<td>You can use renderers here if needed. You can <a title="Blog: How to Reuse Xamarin.Forms Custom Renderers in .NET MAUI" href="https://www.syncfusion.com/blogs/post/how-to-reuse-xamarin-forms-custom-renderers-in-net-maui.aspx">reuse Xamarin.Forms custom renderer</a> when porting.</td>
</tr>
<tr>
<td style="width: 351px;">

<img class="wp-image-100036" src="https://www.syncfusion.com/blogs/wp-content/uploads/2022/05/Xamarin-Renderer-Architecture-1.png" alt="Xamarin Renderer Architecture" width="401" height="52" /> <figcaption>Xamarin Renderer Architecture</figcaption></td>
<td style="width: 351px;">

<img class="wp-image-100038" src="https://www.syncfusion.com/blogs/wp-content/uploads/2022/05/NET-MAUI-Handler-Architecture.png" alt=".NET MAUI Handler Architecture" width="215" height="91" /> <figcaption>.NET MAUI Handler Architecture</figcaption></td>
</tr>
</tbody>
</table>

### 6. .NET 6

.NET MAUI is integrated into .NET 6, whereas Xamarin.Forms is a .NET Framework. Due to .NET 6 integration, you can use the following .NET 6 and C#10 features in .NET MAUI:

- Nullable enable/disable and nullable reference types
- [Source Generators](https://docs.microsoft.com/en-us/dotnet/csharp/roslyn-sdk/source-generators-overview "Source Generators in .NET MAUI")
- [Record structs](https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-10#record-structs "Record structs in C# 10")
- [Interpolated string handlers](https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-10#interpolated-string-handler "Interpolated string handlers in C# 10")
- [global using directives](https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-10#global-using-directives "Global using directives in C# 10")

**Note:** If you are porting your app from Xamarin.Forms to .NET MAUI, you may not be able to use all these .NET 6.0 and C# features, because you may face limitations on your existing code.

### 7. Resource Maintenance

.NET MAUI took over Xamarin in terms of resources, especially in terms of images. You do not need to maintain a set of images for the platform- or device-specific needs. A single SVG image is enough to meet all platform and device requirements. The SVG image gets turned into a .png image to work on all platforms.

<table>
<tbody>
<tr>
<td>Xamarin</td>
<td>.NET MAUI</td>
</tr>
<tr>
<td>Resources include images and classes.</td>
<td>Resources include classes like MauiImage and MauiResources.</td>
</tr>
<tr>
<td>Need to maintain resolution-based images for platform-specific devices.</td>
<td>With the help of SVG images, there is no need to maintain platform-specific or device-specific images.</td>
</tr>
<tr>
<td>Resource files need to be maintained separately for each platform.</td>
<td>Resources can be maintained in a single location.</td>
</tr>
</tbody>
</table>

### 8. Hot Reload Support

Support for hot reload in Xamarin versus .NET MAUI is detailed in the table.

<table>
<tbody>
<tr>
<td>Xamarin</td>
<td>.NET MAUI</td>
</tr>
<tr>
<td><strong>.NET hot reloads</strong>
<ul>
 	<li>Does not support (but UWP has limited support for runtime edits using .NET’s edit and continue feature).</li>
</ul>
</td>
<td><strong>.NET hot reloads</strong>
<ul>
 	<li>Complete <a title="Write and debug running code with Hot Reload in Visual Studio" href="https://docs.microsoft.com/en-us/visualstudio/debugger/hot-reload?view=vs-2022">.NET hot reloads</a> support is available.</li>
</ul>
</td>
</tr>
<tr>
<td><strong>XAML hot reload</strong>
<ul>
 	<li><strong>Experimental:</strong> SDK 4.x and Visual Studio 2019 prior to version 16.9.</li>
 	<li><strong>Feature complete:</strong> SDK 5.x and Visual Studio 2019 version 16.9 or newer.</li>
</ul>
</td>
<td><strong>XAML hot reload</strong>
<ul>
 	<li>Complete support available.</li>
</ul>
</td>
</tr>
</tbody>
</table>

### 9. Graphics APIs

In Xamarin, there is no direct API available to fulfill any drawing requirements. You have to do it on the native side using renderers. But .NET MAUI now abstracts native drawing and brings you better graphics APIs.  The cross-platform graphics functionality in .NET MAUI provides a drawing canvas for drawing and painting shapes.

The brush is the primary type.

<table>
<tbody>
<tr>
<td>Xamarin</td>
<td>.NET MAUI</td>
</tr>
<tr>
<td>No graphics available.</td>
<td>Graphics modes such as <a title="Paint graphical objects in .NET MAUI" href="https://docs.microsoft.com/en-us/dotnet/maui/user-interface/graphics/paint">paint</a>, <a title="Winding modes in .NET MAUI" href="https://docs.microsoft.com/en-us/dotnet/maui/user-interface/graphics/windingmodes">winding,</a> <a title="Blend modes in .NET MAUI" href="https://docs.microsoft.com/en-us/dotnet/maui/user-interface/graphics/blendmodes">blend</a> are available.</td>
</tr>
<tr>
<td>Custom drawing is not possible.</td>
<td>Drawing graphics is possible.</td>
</tr>
<tr>
<td>Color is the primary type.</td>
<td>Brush is the primary type.</td>
</tr>
</tbody>
</table>

### 10. Configuring Resources and Services

Unlike Xamarin, .NET MAUI apps are bootstrapped using the [.NET Generic Host](https://docs.microsoft.com/en-us/dotnet/core/extensions/generic-host ".NET Generic Host documentation"). So, if you want to initialize any fonts, services, or third-party libraries, it can be done through that from a single location.

### 11. Accessibility

Typically in Xamarin, we use automation properties and native APIs to provide proper accessibility to screen readers for text in the controls used in an app.

But .NET MAUI provides _semantic properties_ to provide accessibility values in apps (you can use _automation properties_ in .NET MAUI, but the recommended approach is _semantic_ _properties_).

### 12. Supported Patterns

Another important difference is pattern support.

<table>
<tbody>
<tr>
<td>Xamarin</td>
<td>.NET MAUI</td>
</tr>
<tr>
<td>
<ul>
 	<li><a title="Wikipedia page for Model–view–viewmodel" href="https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93viewmodel">MVVM</a> (model-view-viewmodel)</li>
 	<li><a title="ReactiveUI documentation" href="https://www.reactiveui.net/docs/">RxUI </a>(ReactiveUI) patterns</li>
</ul>
</td>
<td width="50%">
<ul>
 	<li> <a title="Wikipedia page for Model–view–viewmodel" href="https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93viewmodel">MVVM</a> (model-view-viewmodel)</li>
 	<li><a title="ReactiveUI documentation" href="https://www.reactiveui.net/docs/">RxUI </a>(ReactiveUI) patterns</li>
 	<li>MVU patterns (still experimental)</li>
</ul>
</td>
</tr>
</tbody>
</table>

### 13. Blazor apps

Developing Blazor hybrid apps is not possible in Xamarin, but you can build [.NET MAUI Blazor apps](https://docs.microsoft.com/en-us/aspnet/core/blazor/hybrid/tutorials/maui?view=aspnetcore-6.0 "Build a .NET MAUI Blazor app documentation").

### 14. Cross-platform APIs for device features

Both Xamarin and .NET MAUI can provide the following cross-platform APIs for native device features. According to this [Microsoft documentation](https://docs.microsoft.com/en-us/dotnet/maui/what-is-maui "What is .NET MAUI?"), the following are the cross-platform APIs available.

- Access to sensors, such as the accelerometer, compass, and gyroscope on devices.
- Ability to check the device’s network connectivity state, and detect changes.
- Provide information about the device the app is running on.
- Copy and paste text to the system clipboard, between apps.
- Pick single or multiple files from the device.
- Store data securely as key/value pairs.
- Utilize built-in text-to-speech engines to read text from the device.
- Initiate browser-based authentication flows that listen for a callback to a specific app registered URL.

Cross-platform APIs for device features are also integrated with MAUI under **Microsoft.Maui.Essentials** namespace.

<table width="100%">
<tbody>
<tr>
<td width="50%">Xamarin</td>
<td width="50%">.NET MAUI</td>
</tr>
<tr>
<td>Cross-platform APIs for device features can be carried out using <a title="Xamarin.Essentials documentation" href="https://docs.microsoft.com/en-us/xamarin/essentials/">Xamarin.Essentials</a>.</td>
<td>Cross-platform APIs for device features are also integrated with MAUI under <strong>Microsoft.Maui.Essentials</strong> namespace.</td>
</tr>
</tbody>
</table>

### 15. Multiple Windows

In .NET MAUI, [multiple windows](https://docs.microsoft.com/en-us/dotnet/maui/fundamentals/windows#multi-window-support "Multi-window support for .NET MAUI") can be opened on Android, iOS on iPad, Mac Catalyst, and Windows at a time. This support is not available in Xamarin.

## Conclusion

I hope you are now clearer about the differences between Xamarin and .NET MAUI. In terms of learning, you can pick up .NET MAUI quickly if you are well versed in Xamarin. Since .NET MAUI is an improvement on Xamarin, developer productivity will also be improved.

[Xamarin.Forms](https://dotnet.microsoft.com/apps/xamarin/xamarin-forms "Xamarin.Forms") has been with us for nearly seven years! It has played a crucial role in cross-platform app development and has helped countless developers succeed year after year. But now it’s time to say goodbye to Xamarin.Forms and happily welcome [.NET MAUI](https://github.com/dotnet/maui ".NET MAUI GitHub demos"). It’s going to help us be even more successful in app development.

At Syncfusion, we strive to build world-class products that can exceed developer requirements. We are very thankful for your great response to our [Xamarin controls](https://www.syncfusion.com/xamarin-ui-controls "Syncfusion Xamarin UI controls"). Your support and feedback helped in making our Xamarin controls a market leader. With the same spirit, we are delivering our [.NET MAUI controls](https://www.syncfusion.com/maui-controls "Syncfusion .NET MAUI controls"), which will perform even better. Please try them out!

If you have any feedback or any special requirements or controls needed for Syncfusion’s .NET MAUI support, please let us know in the comments below. You can also contact us through our [support forum](https://www.syncfusion.com/forums "Syncfusion support forum"), [support portal](https://support.syncfusion.com/ "Syncfusion support portal"), or [feedback portal](https://www.syncfusion.com/feedback/xamarin-forms "Syncfusion Feedback Portal"). We are always happy to assist you!