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

  • Microsoft Eases Integration with Semantic Kernel AI SDK

    The basic idea is to provide unified API abstractions, especially for idiomatic C# code, to help platform developers and others work with any provider with standard implementations for caching, telemetry, tool calling and other common tasks.

  • Final .NET 9 Preview Ships with Go-Live License

    Visual Studio developers can now download the SDK for .NET 9 Release Candidate 2 with a go-live license, meaning devs get Microsoft support for production applications even before the framework reaches general availability next month.

  • Upcycle Your Old Laptops into a Kubernetes Cluster

    Learn about Windows-to-Linux conversions and how to break and fix cloud containers -- all while helping to save the world from e-waste with some "sheer geeky fun."

  • Visual Studio's Future: Live Help to 'AI-ify Your App'

    Visual Studio guru Mads Kristensen provided a peek into the IDE's AI future, explaining how while in live-coding it will identify opportunities for your own app to use AI to your advantage.

Subscribe on YouTube