Telerik blogs

Welcome to the Sands of MAUI—newsletter style issues dedicated to bringing together latest .NET MAUI content relevant to developers.

A particle of sand—tiny and innocuous. But put a lot of sand particles together and we have something big—a force to reckon with. It is the smallest grains of sand that often add up to form massive beaches, dunes and deserts.

Most .NET developers are looking forward to .NET Multi-platform App UI (MAUI)—the evolution of Xamarin.Forms with .NET 6. Going forward, developers should have much more confidence in the technology stack and tools as .NET MAUI empowers native cross-platform solutions on mobile and desktop.

While it is a long flight until we reach the sands of MAUI, developer excitement is palpable in all the news/content as we tinker and prepare for .NET MAUI. Like the grains of sand, every piece of news/article/video/tutorial/stream contributes towards developer knowledge and we grow a community/ecosystem willing to learn and help.

Sands of MAUI is a humble attempt to collect all the .NET MAUI awesomeness in one place. Here's what is noteworthy for the week of April 18, 2022:

.NET MAUI Release Candidate

Behold! .NET MAUI has reached a major milestone in its journey—Release Candidate (RC) 1 is now available. David Ortinau wrote up the announcement post—there is much to celebrate as .NET MAUI ushers in the next generation of cross-platform app development.

Reaching Release Candidacy pushes .NET MAUI one step closer to General Availability (GA) and for the first time, carries a 'Go Live' license indicating readiness for production apps. The .NET MAUI SDK is now API complete—this means no more breaking changes before GA.

As an evolution of Xamarin.Forms, reaching iOS and Android is given, but .NET MAUI for the first time also reaches the desktop with Windows support through WinUI and MacOS support through MacCatalyst. .NET MAUI ships with 40+ layouts and controls optimized for building adaptive UIs across both desktop and mobile platforms. In terms of UI components, .NET MAUI has everything Xamarin.Forms had ready out of the box, but also adds new controls like BlazorWebView, Border, GraphicsView, MenuBar, Shadow and Window.

.NET MAUI started with the first Preview in March 2021—much has evolved through 14 Previews over a year. Huge kudos to everyone involved in the .NET MAUI teams and the entire developer community coming along for the ride. It has been quite the journey—and we're just getting started.

RunTime and Tooling Updates

As a multi-platform app building framework, .NET MAUI caters to .NET developers wanting to make cross-platforms apps with C#/XAML, while enabling code sharing with web frameworks like Blazor. To pull off the big cross-platform promise and make developer lives easier, .NET MAUI needs to depend on a modern runtime and solid tooling. As .NET MAUI hit the coveted RC status, few other pieces of the puzzle also fell in place.

.NET 6.0.4 is now out with SDK version 6.0.202—the unified runtime works consistently across Windows, Mac and Linux. The .NET MAUI RC1 development guide, however, points to the next preview runtime—.NET SDK 6.0.300. If getting .NET MAUI RC1 bits manually, developers may need to clear their NuGet cache and grab the .NET MAUI workloads with the 'dotnet workload install maui' command, with or without explicit NuGet sources, based on local configurations.

When it comes to tooling, .NET MAUI developers on Windows enjoy greater stability—Visual Studio 2022 version 17.2 Preview 3 is now out. For .NET developers on MacOS, Visual Studio 2022 for Mac Preview 9 is now also out.

While Xamarin tooling is fully baked in, .NET MAUI support is in Preview and being actively worked on. Needless to say, the .NET MAUI ecosystem is getting more stable—if developers had held off tinkering with .NET MAUI, hopefully the RC build nudges them over. The future of .NET cross-platform development is ready to inspire developer confidence.

Migrating to .NET MAUI RC

As with any preview software, iterations often include needed changes for greater goal alignment and performance tuning. .NET MAUI RC build also means the SDK is now API complete—there would be no more breaking changes between now and GA. Since this was the last opportunity, well, there are a few breaking changes compared to previous previews.

Thankfully, the .NET MAUI team has made a good habit of publishing migration guides—how to move existing apps from one preview to the next, and now to RC.

The big change this time is that the beloved Microsoft.Maui.Essentials—the built-in library to access native APIs, is no more. Well, it hasn't gone away—just broken up into more logical granular pieces. Instead of one big monolith that needed tree-shaking before app packages were built, things are now isolated to appropriate namespaces, based on what device/app features developers are wanting to tap into.

The namespaces are logically named—like Microsoft.Maui.Devices, Microsoft.Maui.Devices.Sensors, Microsoft.Maui.Media, Microsoft.Maui.Networking and many more. Each namespace exposes a bunch of public classes/interfaces/enums that map to corresponding device/app features—and everything is nicely documented.

With file-scoped namespace declarations and global usings, developers need not clutter their code files—bring in the appropriate namespace once and be done throughout the app.

The few other changes to migrate apps to .NET MAUI RC include cleaning up Windows Package references after Windows App SDK updates and a more streamlined way in which the BlazorWebView is registered on startup for Blazor Hybrid apps running on .NET MAUI.

Overall, the .NET MAUI API canvas looks clean and settled in ahead of going GA in just about a month. Fun times.

.NET MAUI RC Overview

What can you trust as much as the sun rising each morning? Yes, its Gerald Versluis keeping developers updated on .NET MAUI news, particularly after a release. Gerald produced a video on .NET MAUI Release Candidate—a thorough overview of all that's included in the release. Recapping the .NET MAUI journey was nice, and Gerald was quick to point out the significance of the RC release—GA readiness is now just a month away.

While this is a great time for developers to get started with .NET MAUI, Gerald catered to developers who have long been tinkering with .NET MAUI—the migration guides between .NET MAUI previews are rather handy.

Gerald walked through the last set of API changes that happened in .NET MAUI RC—no more of the Microsoft.Maui.Essentials namespace, options to use the current or default interface implementations through Dependency Injection and the simplified BlazorWebView registration on startup. It was also good to see Gerald mention Xamarin support—the present production reality will supported for 2 years after last major release in Nov 2021, which means till Nov 2023.

.NET MAUI BlazorWebView Updates

.NET web developers are understandably all in with Blazor—one gets to write C# front and back for modern web apps. And now that Blazor goodness, as well as most other types of JS web apps, are welcome on native mobile/desktops, thanks to .NET MAUI.

This little piece of technology voodoo is brought to us by the BlazorWebView—a lightweight abstraction over modern web browsers in iOS/Android/Windows/Mac, which knows how to render almost any web content within a native app. There are some changes in how the BlazorWebView is registered for use in .NET MAUI apps and Vijay Anand wrote about the streamlined process.

Compared to previous Preview builds, in .NET MAUI RC1, the BlazorWevView is ready for usage after a single-step registration that requires invoking only the unified method with DI container. This makes the BlazorWebView initialization a super easy process with the .NET generic host builder and a single AddMauiBlazorWebView() method.

Vijay also points out one key tool that web developers can use with .NET MAUI—the beloved Developer Tools available across any evergreen browser. A simple AddBlazorWebViewDeveloperTools() method off the Buider's Services is all that is needed—developers can then pull up Developer Tools for any page of a .NET MAUI app that renders web content through the BlazorWebView. This is great news for web developers who love to tinker with HTML/JS/CSS on the fly—and now it is possible for mobile or desktops apps as well. Good times.

That's it for now.

We'll see you next week with more awesome content relevant to .NET MAUI.

Cheers, developers!

About the Author

Sam Basu

Sam Basu is a technologist, author, speaker, Microsoft MVP, gadget-lover and Progress Developer Advocate for Telerik products. With a long developer background, he now spends much of his time advocating modern web/mobile/cloud development platforms on Microsoft/Telerik technology stacks. His spare times call for travel, fast cars, cricket and culinary adventures with the family. You can find him on the internet.

Related Posts


Comments are disabled in preview mode.