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 at Converge 360.

comments powered by Disqus

Featured

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube