Today our team is thrilled to introduce you to the latest major stable release of .NET MAUI in .NET 8! We build .NET MAUI to enable .NET developers to create cross-platform applications for Android, iOS, macOS, and Windows with deep native integrations, platform-native user interfaces, and hybrid experiences that extend the reach of Blazor and other web UI technologies. Today marks the third major release of .NET MAUI in the past 18 months which turns the corner from our unifying of the Xamarin platform with .NET into pushing forward .NET as one.
In addition to all the amazing work in the .NET SDK and runtime, we have labored with extreme focus on .NET 8 to fix high impact bugs, isolate and resolve memory leaks, improve the accuracy and reliability of hot reload, ease the path for customers upgrading from Xamarin, retain and improve performance at startup and runtime, and so much more. We are very proud of this release and cannot wait for everyone to start using it.
“Creating Right to Left layouts in .NET MAUI is now a reality thanks to .NET 8. Visual elements are perfectly arranged and Carousels work great now. We’ve been working with the latests preview bits for a while and the improvements the MAUI team did have proven key to successfully deliver RTL apps to our clients.” – Leo, UXDivers for Umrahme
Early feedback like this has been encouraging, and we are eager to hear from you next. Let’s take a look at some of the biggest improvements you’ll get in .NET MAUI.
Overall Quality
Firstly looking at the release by the numbers, in .NET 8 we have:
- 1618 pull requests merged (up from 577)
- 689 bug issues resolved (up from 180)
Compared to the .NET 7 GA release that’s a 180% increase in pull requests merged and 283% more bug issues resolved. Since .NET 7 was a shorter release for .NET MAUI, I thought it would be interesting to include all the .NET 7 service releases as well. Taking that into account, .NET 8 still has 18% more pull requests merged and 13% more bug issues resolved.
This would not have been possible without the 94 wonderful contributors across teams at Microsoft and especially from the community. On behalf of all .NET MAUI users we thank you so much for your continued contributions and support!
Early in .NET 7 servicing we heard loud and clear from developers that we needed to raise the quality of releases, and so we did just that raising the bar on what we would backport from our .NET 8 work to release in .NET 7 until we had more automated testing in place and other processes to better guard against this. During subsequent releases we enabled a dormant suite of Xamarin.Forms tests to run on .NET and against .NET MAUI, and added more than 3500 device tests on Windows spread across the Controls, Core, and Essentials areas among other tests.
Going forward in .NET 8 servicing, the bar is back down and we will ship more bug fixes to .NET 8 than you saw in .NET 7. We know that this was not a popular decision, and we did the work to be more confident in the quality of our quick servicing releases to meet your need.
The top areas of quality improvements are:
- Keyboard behavior, especially on mobile
- FlowDirection support for right-to-left languages
- Layout fidelity and performance
- Scroll performance
- Memory management
Visit the release notes for a complete list of fixes and improvements.
What’s new
The .NET MAUI pedigree is rooted in touch interfaces on mobile and tablet devices, so we have some work to do to enable more desktop specific experiences where user input is more often from keyboard and mouse. This release enables keyboard accelerators, enhances pointer gestures, and more.
Keyboard accelerators
A keyboard accelerator is the shortcut you can associate with any menu item in a desktop application, like copy (Ctrl+C), paste (Ctrl+V), and Cut (Ctrl+X).
<ContentPage.MenuBarItems>
<MenuFlyoutItem Text="Cut"
Clicked="OnCutMenuFlyoutItemClicked">
<MenuFlyoutItem.KeyboardAccelerators>
<KeyboardAccelerator Modifiers="Ctrl"
Key="X" />
</MenuFlyoutItem.KeyboardAccelerators>
</MenuFlyoutItem>
</ContentPage.MenuBarItems>
For more details and advanced examples, see the Keyboard Accelerators documentation.
Pointer gesture enhancements
.NET MAUI has included a PointerGesture
for a while so you knew when the cursor was over an element, and now in .NET 8 you gain PointerPressed
and PointerReleased
events along with event arguments containing more information about the position of the pointer. This works across Android, iPadOS, Mac Catalyst, and Windows.
See the updated Recognize a pointer gesture documentation.
Drag and drop gesture enhancements
To improve the drag and drop user experience we have exposed more APIs on Windows such as including custom glyphs when you initiate a drag, custom captions when you drag, and on iOS and Mac Catalyst for the size of the item you’re dragging, adding custom shapes or images, and customizing the drop actions to indicate if it’s a copy, a move, or a forbidden action.
See the updated Recognize a drag and drop gesture documentation.
Performance and memory improvements
Jonathan Peppers has written in-depth about the work in .NET 8 to improve performance, app size, and address memory leaks. New features include AndroidStripILAfterAOT, AndroidEnableMarshalMethods, and NativeAOT for iOS. These and many other improvements are available so you can choose the best path for reducing your app size and improve performance.
By staying on the leading edge of .NET, you get most of these improvements without having to make any changes to your code.
Miscellaneous highlights
With the enormous amount of work that has gone into this release, it should be no surprise that there’s even more to highlight. For the complete list of changes, enjoy a lengthy read of the .NET MAUI 8.0.3 release notes, and for an abbreviated summary enjoy reading the What’s new in .NET MAUI for .NET 8.
- Publish an unpackaged .NET MAUI app for Windows with the CLI.
- Use
ContentPage.HideSoftInpuOnTapped
to dismiss the keyboard when tapping anywhere on the page - Controls that support text input gain extension methods that support hiding and showing the soft input keyboard. For more information, see Hide and show the soft input keyboard.
- WebView gains a UserAgent property. For more information, see WebView.
- Inline media playback of HTML5 video, including autoplay and picture in picture, has been enabled by default for the WebView on iOS. For more information, see Set media playback preferences on iOS and Mac Catalyst.
- BlazorWebView gains a StartPath property, a TryDispatchAsync method, and enhanced logging capabilities. For more information, see Host a Blazor web app in a .NET MAUI app using BlazorWebView.
- The TapGestureRecognizer class gains the ability to handle secondary taps on Android. For more information, see Recognize a tap gesture.
Get started today
.NET MAUI and .NET 8 are included in today’s stable release of Visual Studio 2022 17.8.
On all platforms, you can develop with .NET MAUI using Visual Studio Code. Install the .NET MAUI extension and let us know how we can improve this preview experience for you in the future.
Download the .NET 8 installer, and then install .NET MAUI from the command line:
dotnet workload install maui
Through the retirement of Visual Studio for Mac next year you can continue developing using Visual Studio for Mac after enabling the preview feature for .NET 8 in Preferences.
For upgrading projects to .NET 8, follow the upgrade guidance on our wiki.
Thank You
On behalf of the .NET MAUI team, thank you for all of your engagement, contributions, and support! We look forward to hearing about your successes, and your feedback on how we can improve the product through .NET 8 service releases and into .NET 9.
Just completed our MAUI upgrade from .NET 7 to .NET 8, super-charging it with Prism.Maui, and couldn’t be more pleased! Sure, there were some minor bumps along the way as you would expect with any package upgrade, but they were all quickly solvable. Absolutely enjoying this new experience.
Thank you, MAUI Team and Prism Library team!!
Hello David, i wanted to know if fluent ui can be used with dotnet maui for desktop and android apps
Inconvenient truth is MAUI will never be “production ready” due to “alienness” to Android platform. If you need high quality app on Android – use Kotlin & Android Studio. And forget that clumsy idea “multiplatform” – it doesn’t exist.
If you don't need multiplatform but still want to leverage .NET, you can absolutely do that. .NET for Android is the underlying binding to Android SDK that MAUI builds upon, and you can use it directly.
is 1:1 with Android platform and even adds C# idioms in many places to feel more natural. If it's the alienness of MAUI compared to Android, then this is the path you might feel more aligned to.
Thanks for sharing detail, appreciate if share the latest sample code links to the examples given in the article
quality is still shit! sorry to say that but it’s reality. too many inconsistency across platforms and bugs that are open for way too long. still a super frustrating experience. I wouldn’t be surprised if Microsoft dumps MAUI soon – still no dogfooding shown at .NET Conf (meanwhile Google migrated Google Earth to Flutter – not a fanboy, just sayin)
Hi Stefan, I'm sorry you're still having that frustrating experience. I hope you've seen positive progress in this release compared to previous. Service releases are already in the process of rolling out with more.
Re: no dogfooding, we have products within Azure, Dynamics, M365, and others using .NET MAUI as mentioned in our .NET Conf presentation.
Updated to VS 17.8. Updated project to .Net 8 (easier than expected) and it all runs still.
Have now found VS seems slow on editing some XAML files and editing some XAML files causes VS to totally crash. No idea why some crash VS and some are just slow editing.
Another Maui joy I guess. Having to edit the files in the new flaky Notepad for now.
Please be sure to report feedback through Visual Studio after you experience a crash so we can investigate that. Glad the update was otherwise smooth.
I have had time to try this a lot more now and have more comments for you.
In general Maui is much improved now that some long overdue bug fixes have been done, it is how the initial release should have been. But there are more bugs to fix that have been waiting a long time, like this from April 2022 https://github.com/dotnet/maui/issues/6644. I do hope the bug fixing effort continues now it is...
Our team’s port to .NET 7 is largely complete at this point, and our update to .NET 8 previews is looking good as well. We’re looking forward to cutting over to 8 before releasing.
Many kudos to your extended team for helping us with Android DEBUG build performance issues that cropped up during our .NET 8 effort. With a few pointers on how to be effective with Speedscope and dotnet trace we identified some unusual slow...
That’s great to hear, thanks for the report George!
It seems that an error has occurred in the presentation of the example for RTL. The picture shows the burial site of the Prophet Muhammad (s.a.v.), but underneath it describes the location of Mecca. This of course hurts the 1.9 billion members of the Muslim community worldwide as our holy sites are not even properly differentiated.
I ask the team to revise.
Thanks for the note. I’ll pass that along.
Thanks David.
I’ve updated the image. Please review.
Updated to new version. It seems to reintroduce the https://github.com/dotnet/maui/issues/9011 bug. Will test few more times, create the issue and probably downgrade to preview version where it was fixed until it is fixed again…
There are too few controls in Maui, and it would be perfect if it could be compatible with WinUI controls
You can use WinUI controls with MAUI on Windows. You also have a wide array of controls from component vendors and the open source community. And you can even use Blazor components mixed with MAUI. You have many many options to explore.
Hi David
With all due respect, I have to disagree with you.
For me, the big missing piece is DataGrid control. Without it, it's hard for a desktop application.
The reason I'm complaining here is I really want to use MAUI.