.NET MAUI layouts have been overhauled, developers question the lack of Linux – Visual Studio Magazine

News

Revamped .NET MAUI layouts, devs question lack of Linux

New layouts have been announced in .NET MAUI Preview 7, and some developers are still wondering about the lack of Linux support in Microsoft’s next-gen evolution of Xamarin.Forms.

The open source .NET Cross-Platform Application UI (MAUI) is a cross-platform framework for building native mobile and desktop applications with C# and XAML. Microsoft calls it an evolution of Xamarin.Forms in part because it adds the ability to build desktop apps in addition to the traditional iOS and Android mobile apps targeted by Xamarin.

However, these desktop apps won’t be Linux-like, which was questioned by several developers in response to the Preview 7 announcement earlier this month.

MAUI (.NET cross-platform application user interface)
[Click on image for larger view.] MAUI (.NET cross-platform application user interface)(source: Microsoft).

After program manager David Ortinau confirmed that “we don’t support Linux as a development environment for .NET MAUI,” said Microsoft director Richard Lander, “it would be good to know how many people would benefit from the support of the Linux environment for development”.

To which one developer replied: “I agree. And generally, I’m sure Microsoft will be able to find the answer in case they need it. However, since “.NET is free. Cross-platform. Open source” and also “supported on Linux, Windows and macOS” and MAUI is .NET, avoiding Linux support brings some dissonance. I was given tools (C#/F#, .NET ), but I can’t use them. Not to mention that most popular cross-platform UI frameworks support Linux, so the question arises.”

Other developers also weighed in with comments, including:

  • Linux support is essential for .NET MAUI education and adoption, as many software engineering students and educational institutions use Linux. Therefore, they generally prefer technology available on all platforms.
  • I think Maui’s main competitor is flutter which supports Linux at scale. so I think Linux support is crucial. Also, there should be extensions (hot reloading and such) to properly develop Maui from vs code.

The issue of lack of Linux support isn’t new, however, as Ortinau addressed it in January in an online presentation about the initial release. He said: “I saw a comment earlier in the chat, you know, really excited about the possibility of Linux support. It’s absolutely on our radar, but I want to be very clear that in our plans what we’re going to support in Linux isn’t part of it, so it’s something that could be evolved from the GdkSharp back-end that Xamarin.Forms has today, but someone going to have to step in and some kind of help contribute and bring this to the line to make it work with .NET 6.”

In other words, Microsoft is relying on community help to add Linux support, which was clearly stated in a Xamarin.Forms 5 vs. .NET MAUI comparison posted at the time which states that Microsoft developers will tackle macOS” support in XF5), but not Linux:

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

The discussion – literally a GitHub discussion titled First Class Linux Support Developed by Microsoft – was also discussed on the .NET MAUI repo, with the original February post saying, “For a company trying to push such a progressive program, the gaslighting Linux users by ‘explaining’ that because Linux is open source, the only way to get Linux support is from the community is downright cruel.

After hundreds of comments, the most recent entry in this thread (two days ago) reads:

The problem is that Microsoft hasn’t committed to saying that it will be supported one way or another. Their current position is that the community will support this feature. I think if Microsoft committed to supporting it in a future update, a lot of those complaints would go away, but it doesn’t. I believe some of the Microsoft engineers are working on a library separately, but not with Microsoft support. That doesn’t mean it won’t be supported in the future, but we can only really rely on what we already know for the facts.

So it looks like Linux support might be coming, one way or another.

Meanwhile, one of the highlights of .NET MAUI Preview 7 is the introduction of new layouts, which help developers showcase their projects in multiple ways, such as grid, flexible layout, horizontal and vertical piles, etc.

A grid landscape layout
[Click on image for larger view.] A grid landscape layout (source: Microsoft).

“So far the layouts you’ve been using in .NET MAUI are the Xamarin.Forms layouts that have been told how to size and position renderers and new handler-based controls” , Ortinau said in the Aug. 11 announcement. “We started with this approach in order to get the UI to the screen quickly and focus our efforts on completing our library of UI 40 controls, and proving our ability to be compatible with migrating projects from Xamarin In parallel, we created optimized layouts based on a new LayoutManager approach using our 7 years of learning Xamarin.Forms layout to optimize consistency, performance and maintainability.

While the old Xamarin.Forms layouts can still be used by developers, the new ones that are now enabled by default include:

Other tweaks affected accessibility, font scaling, and more.

An unusually high number of developer comments (55) testifies to the popularity and interest in .NET MAUI, with several enthusiastic comments such as “Very cool! and “A lot of MAUI goodness. Great job!” (although a lot of comments were back-and-forth about trying to make everything work properly in the fledgling framework).

Ortinau asked developers to provide feedback on features such as deployment, editing, and debugging. Regarding the latter, he noted an existing issue: “At press time, we are troubleshooting the latest Windows App SDK Single-project MSIX extension for Visual Studio 2022 and .NET MAUI to address a debug failure. You can successfully deploy the Windows application directly and run it from the Start menu.”

About the Author


David Ramel is an editor and writer for Converge360.



Comments are closed.