April 26th, 2022

.NET MAUI Release Candidate 2 – With 100% More Tizen

David Ortinau
Principal Product Manager

We are excited to release .NET Multi-platform App UI (.NET MAUI) Release Candidate 2. This release is covered by a “go-live” support policy, meaning .NET MAUI is supported by Microsoft for your production apps. The team has been focused on stabilizing the toolkit, resolving the high impact issues you have been helping us to identify through your valuable feedback. Thank you!

Get Started Today

To acquire .NET MAUI RC2 on Windows, install or update Visual Studio 2022 Preview to version 17.2 Preview 5. In the installer, confirm .NET MAUI (preview) is checked under the “Mobile Development with .NET” workload.

To use .NET MAUI RC2 on Mac, follow the command-line instructions on the wiki. Support for .NET MAUI in Visual Studio 2022 for Mac will ship formally in a future preview.

Release Candidate 2 release notes are on GitHub. For additional information about getting started with .NET MAUI, refer to our documentation and the migration tip sheet for a list of changes to adopt when upgrading projects.

Reminder about Xamarin support The Xamarin Support Policy is still in effect, which covers those products for 2 years after initial release. The last release was in November of 2021, so support will continue through November 2023.

Adding Tizen Platform

Tizen.NET has long enabled .NET applications to run on millions of Samsung TVs, phones, and other devices running Tizen. Today, Tizen joins Android, iOS, macOS, and Windows as one of the target platforms you can reach with .NET MAUI. Congratulations to the Samsung Tizen.NET team on this great milestone!

Visit the Tizen .NET introduction to get started. While the platform support is part of .NET MAUI SDK and we’ve added the scaffolding for Tizen to the .NET MAUI template project, the required workload dependencies are distributed through a separate installation experience maintained by Tizen.

Looking for samples? The Tizen team keeps up to date with all our beautiful sample apps to make sure they run great on Tizen mobile and Tizen TV.

The official Tizen Emulator supporting .NET 6 will be released by the Tizen team soon.

HelloMaui

Tizen emulator

Source

WeatherTwentyOne

Tizen TV emulator running WeatherTwentyOne

Source

.NET Podcast

Tizen emulator and browser running dot net podcasts, .NET MAUI Release Candidate 2

Tizen TV emulator running dot net podcasts

Source

Getting the most from platforms

.NET MAUI excels at giving you the same UI and styling for native controls across all supported platforms, while also giving you broad access to native platform features all from a single .NET language. .NET does this by taking full advantage of multi-targeting to organize code and resources that may span several platforms from a single project.

There may also be scenarios in your applications where you’ll want to customize how it looks and behaves on a specific platform in order to take full advantage of native features only present on that platform, or to unify an experience to be more consistent with other platforms. There are 3 main ways in which you can do this in .NET MAUI:

1. Platform folders

Within the single project structure, we’ve paved the way for you to put platform-specific code and files into folders by platform. The build tasks for .NET MAUI are pre-configured to know that anything you place there will apply only to that platform.

Solution shows platform folders, .NET MAUI Release Candidate 2

2. Filename convention

The .NET MAUI build tasks will also look at filename conventions to determine what code should run for each platform. The source code is actually setup this way as well. The Button handlers suffix the filenames by platform: Android, iOS, Tizen, and Windows.

Button handler files by platform

3. Conditional compilation

Multi-targeting also works via conditional compilation arguments. By using #if, you can segment code per platform from anywhere in your project. For example, in the WeatherTwentyOne app’s MauiProgram.cs, we configure services for local notifications and the system tray, which are very platform-specific APIs.

    var services = builder.Services;
#if WINDOWS
    services.AddSingleton<ITrayService, WinUI.TrayService>();
    services.AddSingleton<INotificationService, WinUI.NotificationService>();
#elif MACCATALYST
    services.AddSingleton<ITrayService, MacCatalyst.TrayService>();
    services.AddSingleton<INotificationService, MacCatalyst.NotificationService>();
#endif
    services.AddSingleton<HomeViewModel>();
    services.AddSingleton<HomePage>();

By default, the following options are available to you:

  • ANDROID
  • IOS
  • MACCATALYST
  • TIZEN
  • WINDOWS

You’ll notice IntelliSense will additionally offer you more specific options to target each platform such as “WINDOWS10_0_17763_0_OR_GREATER” in case you need it.

For additional information on writing platform-specific code, check out the .NET MAUI documentation:

.NET MAUI provides other helpful strategies for adapting your applications to different platforms, screen sizes, idioms, and more. For example, you can leverage these markup extensions and strategies:

  • OnPlatformWidthRequest="{OnPlatform 250, iOS=200, Android=300}"
  • OnIdiomWidthRequest="{OnIdiom 100, Phone=200, Tablet=300, Desktop=400}"
  • Triggers – Property, Data, Event, Multi-triggers, EnterActions, ExitActions, and State

We need your feedback

Install the latest preview of Visual Studio 2022 for Windows (17.2 Preview 5) following our simple guide and build your first multi-platform application today.

We’d love to hear from you! As you encounter any issues, file a report on GitHub at dotnet/maui.

Author

David Ortinau
Principal Product Manager

David is a Principal Product Manager for .NET at Microsoft, focused on .NET MAUI. A .NET developer since 2002, and versed in a range of programming languages, David has developed web, environmental, and mobile experiences for a wide variety of industries. After several successes with tech startups and running his own software company, David joined Microsoft to follow his passion: crafting tools that help developers create better app experiences. When not at a computer or with his family, David ...

More about author

57 comments

Discussion is closed. Login to edit/delete existing comments.

  • Tony A · Edited

    What is the state of Samsung wearable development with .NET?
    My previous experience using Xamarin.Forms and the Samsung developed plugins with Visual studio using the Tizen.Wearable.CircularUI package.
    But this does not seem to have recent development.

    What is the future for Samsung watch development in MAUI? Wearable development in general?
    Please advise.

  • Vassilios Pallis

    Hi David,
    Is this RCx/Visual Studio Preview ever ends?
    At least you should try to support the MAUI RC2 release in Visual Studio 2022 RTM.
    We can’t afford to maintain 2 lines of Visual Studio setup in our hard drives only for MAUI support.

  • Reza Keshvari · Edited

    When can we have MAUI on Visual Studio 2022? (not the preview version)

  • Brian Mathews

    I would love to help log some bugs I’ve found, but Visual Studio Maui RC2’s integrated bug reporting tool requires logging in: and logging in is one of the bugs!! I can’t log in with my Microsoft account, so no way to log anything!

  • Bryan Cass · Edited

    Hi David. I learned full stack web development in Visual Studio 2017-2019 via Microsoft docs and examples, StackOverflow and YouTube over the past 4 years (thank you!) and now have a functioning, commercial web site up and running on AWS. My next task is creating a mobile app for this web site. I found Xamarin and wanted to use that since I already know VS and C#. But then I saw...

    Read more
  • Dave Calkins · Edited

    I'm curious about the support status for this. The post says, "This release is covered by a “go-live” support policy, meaning .NET MAUI is supported by Microsoft for your production apps.". However, to get it, you need to "install or update Visual Studio 2022 Preview to version 17.2 Preview 5".

    On a recent MS support incident, they told me they could not provide support for any "preview" version of Visual Studio. In that...

    Read more
  • stanley broo

    MAUI love it, finally back to something that feels like .NET development. Remember when WPF came with all its tools, it was heaven ..then came Azure …,silverlight died, Windows Mobile died ..and to the rescue Xamarin
    It’s been frustrating years with Xamarin to say the least.

    Now it feels like we’re on the right path again. Love it.

    Good Job!!!!!!! Now just waiting for PRISM to catch up.

  • Klaas Troost

    It is a pitty that my windows maui project does not compile anymore since RC2. There are more people with the same problem. It would be nice when this can be fixed as soon as possible.

    The problem is described at: https://github.com/dotnet/maui/issues/6529. Please help me out.

  • Gordon Moore

    I really wish the images and documentation were checked before you announced things. A simple example is that the image of the solution explorer does not reflect what I see with creating a new blank app. I have shell stuff. This means that documentation l look at is meaningless to me. Its all very well for those in the know, but for noobs it is highly frustrating that I cant get anywhere. Also as an...

    Read more
    • Bryan Cass

      I found the same issue, Gordon. I want to use the new software, but being new to mobile development I’m going to need some help. I just wrote a post on this thread about volunteering to help with the tutorial or documentation. Maybe it would help to have a newbie to the product give some input on what would be helpful.

    • Daniel RothMicrosoft employee

      Thanks for sharing this feedback, Gordon. The .NET MAUI documentation is admittedly still a work in progress with a lot of reliance still on the earlier Xamarin content. We’re working on getting the content updated and expanded so that the experience is friendlier to new users.

  • Erik Gassler

    Greetings,

    I am developing a Maui Blazor hybrid app and one of the features in this app is the ability to create and run PowerShell scripts. This was the first feature I added to this app a little over a month ago and until now it has been working fine. However, after the latest RC2 Preview update I noticed some of my scripts are now failing citing a lack of permissions.

    Trying to investigate why this happened...

    Read more
    • Daniel RothMicrosoft employee

      Hi Erik. Can you share the specific permissions error that you are seeing? .NET MAUI apps running on Windows are fully desktop apps, not UWP apps. .NET MAUI uses WinUI 3 on Windows.