News

Microsoft's Stalled UWP Project Supports .NET 9 to Help WinUI 3 Migration

Microsoft is previewing UWP (Universal Windows Platform) support for .NET 9, providing a path for existing UWP developers to modernize their apps with the latest .NET and Native AOT. That's being done as the company urges devs to switch to Windows App SDK and WinUI 3 because UWP is no longer under active development.

"Are you a UWP app developer considering migrating to Windows App SDK and WinUI 3?" Microsoft's Sergio Pedri, senior software engineer, asked in a DevBlogs post today. "Or wanting to leverage the latest releases of .NET and Native AOT? Or perhaps you've been struggling with referencing new versions of your favorite libraries, because they only include support for .NET 6 and above? Well, look no further! This preview UWP support for .NET 9 provides a path for UWP apps to modernize using the latest version of .NET."

Rather than any new features or functionality for UWP, the preview consists of a set of updated tools and components that are part of .NET, Visual Studio, the Windows SDK and more. They allow devs to use the latest version of .NET and C# for building UWP apps to modernize their apps with .NET 9 while they consider moving toward WinUI 3.

WinUI 3
[Click on image for larger view.] WinUI 3 (source: Microsoft).

UWP was introduced in 2015 with Windows 10, addressing Microsoft's vision for a unified app platform across all Windows devices (PCs, tablets, Xbox, IoT, HoloLens and so on). Various issues and factors stalled the project and Microsoft introduced Windows UI libraries called WinUI 2, a UI framework for UWP, and WinUI 3, the evolution of WinUI that decouples the modern UI framework from UWP, making it available for both UWP and traditional Win32 apps (via the Windows App SDK). Part of the impetus for stalling UWP development seems to be a shift on the part of Microsoft to focus on native Windows app development, now possible via a dizzying array of options, including WinUI 3, Windows Forms, WPF, Xamarin, .NET.MAUI and more:

Desktop Options
[Click on image for larger view.] Desktop Options (source: Microsoft).

Microsoft said the main goals of UWP support for .NET 9 include:

  • Providing a better migration path for UWP developers wanting to migrate to WinUI 3. Rather than having to perform the entire migration in a single step (meaning both updating all the .NET runtime as well as the entire UI framework and app model), the UWP support for .NET 9 provides an incremental path towards WinUI 3.
  • Enabling developers to remove dependencies on .NET Native, so they can benefit from the latest .NET and C# features, no matter what their app model is. If you are currently targeting UWP because you can't migrate to Windows App SDK and WinUI 3 for some reason (maybe because Windows App SDK doesn't support some critical APIs, or because you don't have resources to do a full migration yet), we still want to allow you to get up to par with all other Windows UI frameworks. This update reduces the friction UWP developers experience when attempting to modernize legacy apps using older libraries from the ecosystem.

"Whether you're migrating from UWP to WinUI 3, or you're just trying to be more productive on your app's existing UI framework, this preview lets you modernize to the latest .NET and C# and take advantage of recent tooling improvements to ease your migration journey," Pedri said.

The extensive post goes on to detail how to get started, creating a UWP .NET 9 project, details of the project and much more. As for what's coming up, a XAML designer in Visual Studio is in the works, along with MSTest adding UWP support for .NET 9, WinUI 2, support, coming support for Windows Community toolkit and more.

One cautionary note provided by Pedri: "Like we mentioned in the introduction, the UWP support for .NET 9 is available in preview, so expect some rough edges as we work on improving the developer experience! We hope that in the long run, this will become the preferred way for UWP apps to use .NET and C#, and that as many developers as possible will be able to upgrade their existing UWP apps from .NET Native to the latest .NET and Native AOT."

About the Author

David Ramel is an editor and writer for Converge360.

comments powered by Disqus

Featured

  • Logistic Regression with Batch SGD Training and Weight Decay Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end program that explains how to perform binary classification (predicting a variable with two possible discrete values) using logistic regression, where the prediction model is trained using batch stochastic gradient descent with weight decay.

  • Dev Asks, and 7 Years Later Python in VS Code Delivers Django Unit Test Support

    "We are excited to announce support for one of our most requested features: you can now discover and run Django unit tests through the Test Explorer!"

  • OData Finally Ditches Old .NET Framework

    "The most disruptive change we are making in this release is dropping support for .NET Framework."

  • .NET MAUI, ASP.NET Core Polished in First Release Candidate for .NET 9

    Microsoft shipped the first release candidate for .NET 9, which is nearing feature completeness and production readiness in advance of its November debut.

Subscribe on YouTube