Announcing .NET MAUI Preview 6
Today with .NET 6 Preview 6 we are shipping our latest progress on .NET Multi-platform App UI (MAUI). This release we are all-in on Visual Studio 2022 Preview 2. This also marks the first time we are shipping .NET MAUI as a workload installation. Several new capabilities are now available including gestures, modal pages, view clipping, native alerts, flex layout, and more. Single project also continues to be improved along with adopting the latest release of the Windows App SDK and Visual Studio extensions. Let’s take a deeper look.
Workload Installation
As part of .NET unification, we have introduced the concept of SDK workloads to enable specific developer scenarios on top of the .NET SDK you’ve installed. In preview 4 the underlying SDKs for Android, iOS, macOS, and Mac Catalyst were enabled, and now in preview 6 we are introducing the maui
, maui-mobile
, and maui-desktop
workloads. The first will acquire and install all the required SDKs for building .NET MAUI applications. If you are only wanting to target mobile or desktop, you can choose those individually.
In the near future Visual Studio 2022 will include these with its installer. To use them today, jump into your favorite CLI. First, take a look at what you have installed already:
dotnet sdk check
This reports what has been installed via the .NET SDK installer itself. Now to see the additional workloads run:
dotnet workload list
To then install .NET MAUI you can execute:
dotnet workload install maui
What about the
maui-check
dotnet tool? We will continue to updatemaui-check
with each release as it does additional validation of your development environment to help you be successful: checking for OpenJDK, emulators, Xcode, Visual Studio versions, and more.
For more information about mobile and desktop workloads, read details here.
New .NET MAUI Capabilities
As you can see on our status report, we are very close to being completely green for enabling features in .NET MAUI. Let’s highlight a few of the newcomers.
Gestures
Gesture recognizers allow you to apply tap, pinch, pan, swipe, and drag-and-drop to any view instance. You can apply them easily in XAML:
<Grid>
<Grid.GestureRecognizers>
<TapGestureRecognizer NumberOfTapsRequired="2" Command="{Binding OnTileTapped}" />
</Grid.GestureRecognizers>
<!-- Grid content -->
</Grid>
In this example, when the weather widget tile is double-tapped, it simulates a refresh with a fade-out, fade-in animation.
Clipping
When you need to mask content you can now add shapes to the clipping region of a layout or view. The most common use for this is to make a circle image.
<Image Source="face.png">
<Image.Clip>
<EllipseGeometry RadiusX="80"
RadiusY="80"
Center="80,80" />
</Image.Clip>
</Image>
Native Alerts
Each platform has a native way of displaying alerts to users. These can be simple informational popups, simple input forms, and even action sheets with multiple options to guide a user. These are available from any Page
in a .NET MAUI application.
await DisplayAlert ("Alert", "You have been alerted", "OK");
These are just a few of the controls and layouts updated in preview 6. For a complete list, check out the commit log on GitHub. A few sweeping changes for layout, borders, corners, and shadows will be arriving in preview 7.
Single Project and Windows
We’ve made a few updates to single project based on developer feedback and Windows support to adopt the latest features. Some of you have been following along with each release, and we love that! Thank you for providing your feedback and engaging with us on GitHub and Discord. So, what has changed in preview 6 that you’ll need to update in your existing solutions?
- The NuGet package is replaced with the .NET MAUI workload (
<UseMaui>true</UseMaui>
in the .csproj). - Single project solutions now nest individual platforms within a “Platforms” folder for tidy organization.
- Updated to Windows App SDK 0.8.1 RC. Use the latest Visual Studio 2022 compatible extension from the marketplace.
Get Started Today
First thing’s first, install .NET 6 Preview 6. Now add the maui
workload using the command above. Also make sure you have updated to the latest preview of Visual Studio 2022, or if you’re on macOS you can continue using CLI and your favorite code editor as we await the debut of Visual Studio for Mac 2022.
Ready? Create new app from the command line and then open the solution in Visual Studio 2022.
dotnet new maui -n HelloPreview6
In future versions of Visual Studio 2022 the .NET MAUI templates will appear in the File > New list. Until then, the CLI is your good friend.
Xcode 13 Beta 1 is the new minimum requirement for iOS and macOS. For additional information about getting started with .NET MAUI, refer to our documentation.
Feedback Welcome
Please let us know about your experiences using .NET MAUI Preview 6 to create new applications by engaging with us on GitHub at dotnet/maui.
For a look at what is coming in future releases, visit our product roadmap.
59 comments
I try install a workload maui and crashed:
Comprobando Microsoft.NET.Workload.Mono.ToolChain.Manifest-6.0.100.6.0.0-preview.7.21365.2
error: NU3004: El paquete no está firmado.
Error de validación de la firma del paquete.
dotnet –version
6.0.100-preview.6.21355.2
Exists any method to install this package with skipping signature?
By any chance have you added a nuget.config with additional feeds or previously installed previews from different channels with maui-check? Somehow it appears your system is aware of more than just the public workload feed we are shipping preview 6 on.
Thank for you response.
My solution for this “issue” is:
All is Ok.
Successfully installed workload(s) maui microsoft-ios-sdk-full microsoft-maccatalyst-sdk-full microsoft-macos-sdk-full microsoft-tvos-sdk-full.
DisplayAlert?
It returns a Task, so it should be DisplayAlertAsync. I then checked out the documentation, and it doesn’t accept a CancellationToken???
I know this is still in preview, but who codes like this in 2021? Seriously, do your build tools not scream out, “WTF are you doing?”
This is ported code from Xamarin.Forms. When implemented so many years ago I don’t believe the native toolkits offered a uniform programmatic way to close the alerts. Please open an issue and/or pull request: https://github.com/dotnet/maui
Thanks for your response.
I have one more question: Why in olders versions of .Net 6 sqlite rules ok an now crashed?
I using a:
Thaks in advance.
Hi David
Quick pointer please – how do you debug the Windows build target (as opposed to Android / iOS, etc) of a Preview 6 Maui Blazor app (created via “dotnet new maui-blazor”)?
In preview 5, you could debug the xxx.WinUI application and it would execute – now Visual Studio throws an errror and says “The project doesn’t know how to run the profile xxx.WinUI.” This happens in both latest preview versions of VS 2019 / 2022.
Cheers.
Why is MAUI using Catalyst for macOS? A technology created by Apple to bring iOS apps into macOS and with restrictions, not exposing the full functionality of macOS.
https://developer.apple.com/documentation/uikit/mac_catalyst
I bet that Visual Studio for Mac team surely isnt’t using Catalyst for their rewrite.
I logged in to ask that exact question. I understand it must be easier for MAUI to support it since MAUI already supports iOS, but I personally won’t be using MAUI for any Mac apps if it only supports Catalyst. Not only does it not provide access to all the APIs I might need, Catalyst apps don’t truly feel native. And the only reason I’d use MAUI over some other ‘write-once-run-everywhere’ tool is because MAUI gives me a native UI on every platform, which other tools don’t do.
So why stop at a near native UI instead of the real native UI, MAUI?
awesome!!!, can you tell me please de release date of MAUI (not preview)… I search in the web and no results.. Thanks!
I am trying to convert a Xamarin.Forms ListView to .NET MAUI, but binding is not working.
Are there any samples on .NET MAUI ListView? I can’t find any.
I’ve updated “maui-check” and run it, without executing “dotnet workload install maui”.
Then I’ve run “dotnet workload install microsoft-net-sdk-blazorwebassembly-aot”. The execution aborted (too bad I don’t have the error).
Running”dotnet workload list” shows an empty list.
Trying to fix it, I’ve run “dotnet workload install maui”, but the execution aborted too:
Installing pack Microsoft.Android.Sdk version 30.0.100-preview.6.62…
Workload installation failed, rolling back installed packs…
…
Workload installation failed: Number of entries expected in End Of Central Directory does not correspond to number of entries in Central Directory.
Despite it, running “maui-check” returns “- Congratulations, everything looks great!”.
Running”dotnet workload list” still shows an empty list.
Running “dotnet new maui -n HelloPreview6” returns:
Nessun modello corrispondente trovato: ‘maui’. (my translation: “No ‘maui’ template found.”)
Per elencare i modelli installati, eseguire ‘dotnet dotnet new –list –list’.
To search for the templates on NuGet.org, run ‘dotnet new maui –search’.
Any hint on how to solve?
Never mind, I’ve solved.
I’ve run “dotnet workload install maui” again and this time it succeeded.
Maybe because I’ve used the Android SDK Manager to install Android 11.0 – R (API Level 30), specifically the “Google API Intel x86 Atom64 System Image” that wasn’t installed, or because I closed the VS 2022 instance that on previuos run was open.
Hello Everyone
I have problem when I try to use this command: dotnet workload install maui
error:
Failed to update the advertising manifest microsoft.net.sdk.android: Failed to fetch results from V2 feed at ‘https://nuget.telerik.com/nuget/FindPackagesById()?id=’microsoft.net.sdk.android.manifest-6.0.100’&semVerLevel=2.0.0’ with following message : Response status code does not indicate success: 401 (Logon failed.)..
Failed to update the advertising manifest microsoft.net.sdk.ios: Failed to fetch results from V2 feed at ‘https://nuget.telerik.com/nuget/FindPackagesById()?id=’microsoft.net.sdk.ios.manifest-6.0.100’&semVerLevel=2.0.0’ with following message : Response status code does not indicate success: 401 (Logon failed.)..
Failed to update the advertising manifest microsoft.net.sdk.maccatalyst: Failed to fetch results from V2 feed at ‘https://nuget.telerik.com/nuget/FindPackagesById()?id=’microsoft.net.sdk.maccatalyst.manifest-6.0.100’&semVerLevel=2.0.0’ with following message : Response status code does not indicate success: 401 (Logon failed.)..
Failed to update the advertising manifest microsoft.net.sdk.macos: Failed to fetch results from V2 feed at ‘https://nuget.telerik.com/nuget/FindPackagesById()?id=’microsoft.net.sdk.macos.manifest-6.0.100’&semVerLevel=2.0.0’ with following message : Response status code does not indicate success: 401 (Logon failed.)..
Failed to update the advertising manifest microsoft.net.sdk.maui: Failed to fetch results from V2 feed at ‘https://nuget.telerik.com/nuget/FindPackagesById()?id=’microsoft.net.sdk.maui.manifest-6.0.100’&semVerLevel=2.0.0’ with following message : Response status code does not indicate success: 401 (Logon failed.)..
Failed to update the advertising manifest microsoft.net.sdk.tvos: Failed to fetch results from V2 feed at ‘https://nuget.telerik.com/nuget/FindPackagesById()?id=’microsoft.net.sdk.tvos.manifest-6.0.100’&semVerLevel=2.0.0’ with following message : Response status code does not indicate success: 401 (Logon failed.)..
Failed to update the advertising manifest microsoft.net.workload.mono.toolchain: Failed to fetch results from V2 feed at ‘https://nuget.telerik.com/nuget/FindPackagesById()?id=’microsoft.net.workload.mono.toolchain.manifest-6.0.100’&semVerLevel=2.0.0’ with following message : Response status code does not indicate success: 401 (Logon failed.)..
Installing pack Microsoft.Maui.Core.Ref.android version 6.0.100-preview.6.882+sha.ef4518bf5-azdo.4905211…
Workload installation failed, rolling back installed packs…
Rolling back pack Microsoft.Maui.Core.Ref.android installation…
Workload installation failed: Unable to load the service index for source https://pkgs.dev.azure.com/holguintech/1c5a82e0-3203-4a31-9ca7-b36db395721f/_packaging/HolguinTech-Framework/nuget/v3/index.json.
I really think Microsoft should try to use the MAUI to create their applications like “Microsoft Teams” or Outlooks first. To experiment the native controls before finally releasing a stable release for MAUI later ….
I doubt if somebody could make some advanced chat UI as smooth as native platforms with current state of Xamarin Forms. One of the most important control is the CollectionView and a lot of people have different issues about it so far. So I really hope MAUI could make these fundamental controls like this better.
Hi guys! I am very impressed with the .NET MAUI but what the future of the Xamarin Native applications? How long Microsoft will support this approach?
I found that Xamarin Forms will be supported for the next year after the .NET 6 release (as I understand until November 2022). But it is not clear about Xamarin Native. Will I be able to have 2 different projects for Android and iOS in one solution and build UI with Android xml layouts for Android and storyboards for iOS? I would be very grateful to you for a detailed answer.
I don’t think many things will changed with Xamarin Native.
MAUI is more about Xamarin Forms, to redo what’s so bad in Xamarin Forms before. Though they’re still going through mono framework, which means these controls have to be rendered through Xamarin Native layer, so as long as MAUI is still alive, Xamarin Native is still an approach.
Thank you, Unamed000, for your answer! I’m also understand situation like you described, but wanted to get a response from a Microsoft official like David Ortinau.