.NET MAUI Release Candidate – Ready for cross-platform app development

David Ortinau

Today we are excited to announce the availability of .NET Multi-platform App UI (.NET MAUI) Release Candidate. The SDK is now API complete, ready for libraries to update and make ready for GA (general availability) compatibility. As with other .NET release candidates, this release is covered by a “go live” support policy, meaning .NET MAUI is supported by Microsoft for your production apps.

Image dotnet podcasts

Get Started Today

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

To use .NET MAUI RC1 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 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.

Jump start your journey with the .NET Podcasts app (pictured above) which runs on Android, iOS, macOS, and Windows, and showcases both native app UI as well as Blazor Hybrid. Looking for a full workshop on how to get started with .NET MAUI? We have you covered with our newly released .NET MAUI workshop where you will build an app from start to finish and integrate native features.

What 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 November of 2021, and so support will continue through November 2023.

What’s in the .NET MAUI release candidate?

As a multi-platform app building framework, .NET MAUI leverages platform SDKs for Android, iOS, macOS, and Windows. These foundational pieces are included in this release, and you can use them directly with C# in addition to maximizing your code sharing and productivity with .NET MAUI.

base theme for all controls

.NET MAUI ships with 40+ layouts and controls optimized for building adaptive UIs across both desktop and mobile platforms. You can also incorporate Blazor components or entire Blazor applications to distribute the same experiences on desktop and mobile as you may today on web.

How does this compare to Xamarin.Forms? You get every UI control that ships with Xamarin.Forms, plus new controls such as BlazorWebView, Border, GraphicsView, MenuBar, Shadow, and Window.

Layouts CarouselView Line Stepper
AbsoluteLayout Checkbox ListView SwipeView
BindableLayout CollectionView Path Switch
FlexLayout ContentView Picker TableView
GridLayout DatePicker Polygon TimePicker
HorizontalStackLayout Editor Polyline WebView
StackLayout Ellipse ProgressBar Pages
VerticalStackLayout Entry RadioButton ContentPage
Views Frame Rectangle FlyoutPage
ActivityIndicator GraphicsView RefreshView NavigationPage
BlazorWebView Image RoundRectangle TabbedPage
Border ImageButton ScrollView Shell
BoxView IndicatorView SearchBar
Button Label Slider

These are all documented in addition to related topics such as:

The new .NET MAUI project template now includes a default stylesheet in “Resourcesstyles.xaml” with a color palette and styling for all the controls. Take for example the Entry. When starting a new application these text inputs will now begin with a shared theme while still being true to the platform on which it runs.

<Style TargetType="Entry">
    <Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource White}}" />
    <Setter Property="FontFamily" Value="OpenSansRegular"/>
    <Setter Property="FontSize" Value="14" />
    <Setter Property="PlaceholderColor" Value="{AppThemeBinding Light={StaticResource LightGray}, Dark={StaticResource DarkGray}}" />
    <Setter Property="VisualStateManager.VisualStateGroups">
        <VisualStateGroupList>
            <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal">
                    <VisualState.Setters>
                        <Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource White}}" />
                    </VisualState.Setters>
                </VisualState>
                <VisualState x:Name="Disabled">
                    <VisualState.Setters>
                        <Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource LightGray}, Dark={StaticResource DarkGray}}" />
                    </VisualState.Setters>
                </VisualState>
            </VisualStateGroup>
        </VisualStateGroupList>
    </Setter>
</Style>

For views that support different states we’ve created a sensible default, and provided light and dark mode color options. For more information check out:

Customizing Controls

One of the things .NET MAUI does to improve upon the Xamarin.Forms architecture is adding low-code hooks to modify just about anything. Let’s consider the canonical example of removing the distinctive Android underline on an Entry field. How might you go about doing this when there is no multi-platform style for “underline” because it only exists on Android?

#if ANDROID
Microsoft.Maui.Handlers.EntryHandler.Mapper.ModifyMapping("NoUnderline", (h, v) =>
{
    h.PlatformView.BackgroundTintList = ColorStateList.ValueOf(Colors.Transparent.ToPlatform());
});
#endif

That’s all the code there is. This code just needs to run somewhere in the start of your application before the handler is called.

Let’s explain what is going on here. Firstly, the #if ANDROID is a conditional compilation directive that indicates this code should only run for Android. In other cases where you are modifying the control for ALL platforms, this isn’t necessary.

Next, we need need access to the control. The Entry you use is a .NET MAUI control. Each property, command, event, etc. of the Entry is “mapped” by a “handler” to a platform implementation. To modify a mapping you can tap into it via the handler’s map such as Microsoft.Maui.Handlers.EntryHandler.Mapper. From the mapper we have 3 methods:

  • PrependToMapping which runs before the .NET MAUI code
  • ModifyMapping which runs instead of the .NET MAUI code
  • AppendToMapping which runs after the .NET MAUI code

For this case it doesn’t matter which one we use, as it will be called at least once, and no other implementation on the Entry will touch the native properties we need to modify. Here the coded uses ModifyMapping and adds an entry called “NoUnderline”. Typically the property matches the name of an actual property, however in this case we are introducing a new one.

The h in the action is the handler which gives us access to the PlatformView which in this case is of Android type TextView. At this point the code is working directly with the Android SDK.

With the underline now out of the way, you can implement your own design of, say, a bordering box like old-school Windows Phone.

border around an entry view

<Border Stroke="{StaticResource Black}"
        StrokeThickness="2"
        StrokeShape="Rectangle">
    <Entry
        Margin="20,4"
        Placeholder="Username" />
</Border>

For more examples on how you can easily modify the look and feel of controls at the cross-platform as well as platform specific layers, check out the documentation for customizing controls.

We need your feedback

Install the latest preview of Visual Studio 2022 for Windows (17.2 Preview 3) 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.

73 comments

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

  • Nathan Ferreira 0

    How MAUI can be classified as “cross-platform app development” if don’t have any support for GNU desktops?

    • Nicolas KRIER 0

      No support yet* with MAUI architecture, it might be easier than ever before to do something (community, open source)
      GNU desktop support isn’t that much asked. I mean, xamarin (and so do MAUI) sir better for B2B app than B2C. And in business app, GNU isn’t used at all (almost). Not a big loss. Even Mac os support isn’t that awesome IMHO.

      • David OrtinauMicrosoft employee 0

        As you may be aware, there is this fork of dotnet/maui that runs on Linux: https://github.com/jsuarezruiz/maui-linux

        And these UI controls https://github.com/dotnet/Microsoft.Maui.Graphics.Controls are aligned with the architecture and could run on Linux.

        Please consider supporting these efforts and building awareness of others, including Avalonia and Uno.

        Also, let me know what your use cases are for targeting Linux as a platform so we can plan our roadmap for .NET MAUI. david.ortinau@microsoft.com

        • JinShil 0

          Our use case is Linux embedded systems and industrial panel PCs that run HMIs. If we could have a Linux WebView that supported Blazor running on the local runtime, in the same way it works with WPF and Winforms on Windows, we’d be mostly satisfied. If I could figure out how to plum _framework/blazor.webview.js with the Linux GTKWebView, I’d probably be good to go.

    • Nadjib Bait 0

      I don’t know… but Android, iOS, Windows and Web is enough “cross-platform” for me.

      • Francisco 0

        @nadjib bait. MAUI does not support web, you cannot develop 100% in C# with XAML and generate an application that runs inside a browser.

        • Santiago Estrada Rubio 0

          I agree with you, Francisco: WEB platform is missing (Webassembly for instace) and I need it.

          In my opinion, MAUI is the correct cross-platform strategy. But I am using UNO platform because it officially supports Webassembly.

    • Szymon Dolny 0

      no one cares about desktop linux

      • Jan SeriÅ¡ 0

        yep exactly this

      • Nicolas Le Gal 0

        Wow how wrong U R, in industry most of systems are bases on linux ans Java is used for .Net. Why ? Linux is free and in Big industry there is plenty of pc, servers…

        I thought it was obvious for everyone ^^
        Supporting UI desktop is the missing argument.

      • Santiago Estrada Rubio 0

        I agree, I need Webassembly and I don’t care about Linux Desktop.

      • anonymous 0

        this comment has been deleted.

      • Klaus Hattinger 0

        I care about desktop linux because my customers ask for it.

      • Brian Conrad 0

        Maybe Microsoft fears Linux as a form of competition? I certainly prefer using Linux over Windows. And I prefer have my project in one place on one machine and not having to move it around for other platforms. That is true cross development.

        • Kyle Andres 0

          Your information seems to be out of date.
          1) There is a fork of MAUI for Linux
          2) Microsoft has been making more of their software available on Linux. VSCode, Edge and Teams are few examples
          3) They contribute to the kernal
          4) More open source every year
          5) Bash on Windows

          I like Linux but it isn’t on the same level as Windows or MacOS for typical users every day machine. I don’t think Microsoft or Apple is concerned about Linux as competition.

    • Michael Bond 0

      I’d say Blazor Hybrid is sort of the escape hatch for GNU desktop support at the moment.

    • Jeff Epstein 0

      GNU is still a thing?

  • Tim Belvin 0

    I was hoping Shell would be a template for this release. When will their be a Shell template?

    • David OrtinauMicrosoft employee 0

      Shell is the default template for new apps now, and styling is provided in the styles.xaml file. Are you looking for an “item template” that implements Shell?

      • Rafael Bischof 0

        When I create a new “.NET MAUI App (Preview)” project it still looks exactly the same as before. Shell isn’t used, and there is no styles.xaml file to be found. What am i doing wrong? I even uninstalled and reinstalled VS 2022 Preview.

        On top of that, those newly created projects don’t compile. I get the following errors:
        Error NU1605 Detected package downgrade: Microsoft.Graphics.Win2D from 1.0.1 to 1.0.0.30. Reference the package directly from the project to select a different version.
        Error NU1605 Detected package downgrade: Microsoft.WindowsAppSDK from 1.0.1 to 1.0.0. Reference the package directly from the project to select a different version.
        It looks like my VS is still using the old templates, but i have no clue how to get VS to use the new one. I tried deleting the template cache too to no avail.

        Edit: Finally got it to work with the command
        dotnet new –install Microsoft.Maui.Templates::6.0.300-rc.1.5355 –force
        It’s a real pain that such obscure stuff is necessary. I found the hint somewhere on the .NET MAUI github discussion board…

  • zekad noureddine 0

    as a Net developer, for me it’s very good tool, I converted my Blazor webassembly application to net Maui Blazor successfully… it’s beautiful….!!. Anyway, that’s my personal opinion!

    • David OrtinauMicrosoft employee 0

      Love to hear that! We’ve heard of several .NET MAUI + Blazor apps already shipping to the various app stores.

      • James Barton 0

        How did you do the conversion? Is there a guide or some resources or is it simply that intuitive? Cheers

      • Maurizio Ziraldo 0

        How can be possible? There still this bug open:

        https://github.com/dotnet/maui/issues/4329

        and it is impossible to deliver a MAUI+Blazor app to other computers (Windows) without Visual Studio installed

  • Jan SeriÅ¡ 0

    Just awesome. looking forward to implement in this with the new MVVM community toolkit.
    I hope all bugs for Android will be fixed soon.

    • David OrtinauMicrosoft employee 0

      Me too; I love what I’ve seen in all the community toolkits!

      Driving down the issues will be our main focus for the next several sprints. Please file anything new you find!

      • Vahid Rafael 0

        Interesting

  • kevin mungame 0

    Has been a long wait, hope it’s coming soon in vs2022.

  • Dmitriy Makarov 0

    Congratulations. This is great news! Good job! I have been making on maui for a long time and it is developing very fast.

  • Corne Rabe 0

    Congratulations getting to RC! Have been using MAUI for a while and I really enjoy it so far.
    A bit sad to not see the CameraView yet, or will this be added later or in the Community Toolkit?

    • David OrtinauMicrosoft employee 0

      I don’t believe CameraView will make the near-term roadmap for the toolkit. Check that repository for more information.

      In the meantime, handlers make it a lot easier to build a cross-platform custom control. If you have an immediate need, I would go that route.

  • Mark Dev 0

    Hi David,
    This fantastic news, however the reality is that in the real world out there third parties etc are not ready and Xamarin forms will be there for a long while till the main libraries catch up!!

    Syncfusion Controls wont be fully there till december
    Biometrics — Maui.Essentials should really cover this one, such a basic in any app, we have to rely on third parties and those are not ready for MAUI
    Prism – Wonderful library but those 2 guys are way too busy and we hardly get any updates and there is no sign whatsoever of having a MAUI release.
    Shell: Does it offer a navigation service like prism does ? This way we can remove the dependency from prism
    FFImageLoading – Does MAUI fully handle SVG and totally replace this no longer supported library?

    and above is just scratching the surface.

    The reality David is that unless those libraries are MAUI compatible we are STUCK!

    thanks

    • David OrtinauMicrosoft employee 0

      Yes, there will be a period of time where the ecosystem adopts the .NET MAUI release and update their offerings. This RC is the tip of the spear that same have been waiting for to begin their updates. And in other cases new solutions will replace old dependencies.

      All of the things are possible in .NET MAUI. Until 3rd party libraries are readily available, it will be more work on app developers. I hope though that many things are much easier in .NET MAUI than previously in Xamarin.Forms.

      Shell does offer URI based navigation, but it’s not quite the same as Prism.

      .NET MAUI does support using svg images. Put them in the Resources/Images folder and we will generate pngs that are optimized for the multi-dpis you’ll need on each platform.

      Our role is to make a great SDK, and enable and empower the ecosystem to add value. Give it some time if you depend on those products, and certainly let them know how much you appreciate and rely upon them.

  • Mateusz Pazdan 0

    Does Microsoft plan to migrate their mobile Office applications from React Native to .Net MAUI ?

    • David OrtinauMicrosoft employee 0

      I hope that as .NET MAUI matures it will strongly tempt them to eventually consider using .NET MAUI!

      • Muhammad hamid 0

        Hi , I am Using MS SQL in .NET Maui Project and I am not able to get connected . the problem is that when i am using System.data.Sqlclient it is not showing me mssqlconnection object so i tried with Microsoft.data.mssqlclient and this time it is giving error “Connection was established but there is problem during pre login handshake ” can you please give me any suggestion ,
        regards M.Asad.

Feedback usabilla icon