News

New .NET MAUI Workload Installation Detailed in 'Final Xamarin Podcast'

As Xamarin.Forms is being evolved into the new .NET MAUI mobile/desktop dev framework, Microsoft last week explained features such as a new command-line SDK workload installation experience during what the company called "The Final Xamarin Podcast."

.NET Multi-platform App UI (MAUI) is a cross-platform framework for creating native apps with C# and XAML, evolving Xamarin.Forms by adding support for desktop development along with the traditional iOS/Android mobile development options.

Microsoft's David Ortinau was on hand to discuss .NET MAUI with James Montemagno and Matt Soucoup in their Xamarin podcast, which this week was published with the title "The Last Xamarin Podcast" as the dev team works on the Xamarin-to-.NET MAUI transformation.

.NET MAUI
[Click on image for larger view.] .NET MAUI (source: Microsoft).

On the new-feature front, Ortinau discussed a new SDK loading experience, which he called a "network load," using the new dotnet network install command. It's backed by NuGet, which is used by Microsoft to install Android, iOS, macOS, .NET MAUI, Blazor and other tooling. "So with the dotnet installer, you can actually install optional workloads, of which MAUI is now one," said Ortinau, principal program manager, .NET Multi-platform App UI. "So if you are a command-line junkie and you really, really enjoy getting getting your fingers dirty with keystrokes, then this is for you. So you can do a network load install command and pass MAUI as the workload ID and it will go out and grab all the SDKs that you need to be able to run a MAUI application."

Ortinau was referring to the new SDK workload installation scheme introduced with .NET 6 Preview 4 in May, allowing developers to use a command-line interface (CLI) to install .NET 6 SDK optional workloads. ".NET 6 will introduce the concept of SDK workloads that can be install after the fact on top of the .NET SDK to enable various scenarios," Microsoft said at the time. "The new workloads available in preview 4 are .NET MAUI and Blazor WebAssembly AOT workloads."

The functionality was expanded last month with the release of .NET 6 Preview 5.

"We're now in the second-half of the .NET 6 release, and starting to see significant features coming together," Richard Lander, program manager on Microsoft's .NET team, said at the time. "A great example is .NET SDK Workloads, which is the foundation of our .NET unification vision and enables supporting more application types. Like other features, it is coming together to provide a compelling end-to-end user experience."

The SDK workloads scheme will replace the old monolithic SDK approach, which was burdened by a long build times and large distribution sizes.

"Instead, all new workloads will be built and delivered separately from the SDK, and will be acquirable via your favorite installation tool (like the Visual Studio Installer, a Linux package manager, or the .NET CLI)," Lander said. "In the fullness of time, we intend for all .NET workloads to follow this pattern, resulting in a very small and focused SDK."

So it basically acts like a package manager for the .NET SDK.

"The only thing it's not going to do for you is get your Android emulators, your iOS, Xcode installed, and some of those other third-party dependencies, but in terms of all the .NET things it's going to do that for you," Ortinau said last week. "Now, the good news is -- jumping to the other side, the very familiar experience -- this is all still part of the Visual Studio installer experience. So when you go install Visual Studio in a future release, this isn't there yet, but it will use that same workload infrastructure, but giving you that familiar installer experience. So you'll check the box on the .NET MAUI workload inside the installer, and you'll also get all of the all the SDKs you need, but then it will additionally give you the Android emulators and tell you if you need Xcode installed, all that sort of thing. Open JDK I think is another dependency that it wants to get for you, and and all of your templates are also bundled with it."

He explained that the .NET MAUI Check tool previously recommended by Microsoft to check a machine setup and install needed components uses the same underlying functionality. "So this is the first-party .NET way of doing things, and so it works as well with other workloads, not just MAUI, not just Android and iOS, but as well as WPF and other workloads. The MAUI check tool actually uses all this same workload stuff behind the scenes, so it kind of is a facade of value-add on top of the .NET workload install. The MAUI Check tool will stick around for as long as it's useful, but more and more of the functionality we have there, we'll be talking to the team that owns the .NET installer and how we can bring things together and make them all work nicely together."

Other new features the team is working on for Preview 6 include improved gesture support, so gestures can be used with other view elements besides buttons. Also coming is clipping support for shapes -- providing the ability to mask different pieces of a UI. Another one is a new platform folder for the single-project template, "So what this effectively means is that the Android, iOS, Mac and Windows subfolders can all now be nested up nice and tidy up inside of a platform folder."

As a .NET MAUI preview will ship with Visual Studio 2022 previews, Ortinau said developers will get hot reload, single-project experiences XAML and more goodies, including migration/upgrade tools and documentation for them and other tooling.

Speaking of migration and upgrading, the .NET MAUI roadmap shows that for .NET 6 Preview 6, coming this month, Microsoft expects to have a version of the .NET Upgrade Assistant that can migrate Xamarin and Xamarin.Forms projects to .NET 6 and .NET MAUI.

The .NET Schedule
[Click on image for larger view.] The .NET Schedule (source: Microsoft).

"So we want to make it as easy as possible because we know that we want to start delivering a lot more of the quality releases and new features and functionality, and the vehicle for us to ship those is going to be .NET 6 and .NET MAUI and then of course .NET 7. We're already starting to think about that one. .NET 8, it's coming."

.NET MAUI will reach general availability in November along with the landmark .NET 6 release.

About the Author

David Ramel is an editor and writer at Converge 360.

comments powered by Disqus

Featured

Subscribe on YouTube