To migrate your app from the Universal Windows Platform (UWP) to the Windows App SDK, your UI code likely needs just a few namespace changes, while much of your platform code can stay the same. You'll need to adjust some code due to differences between UWP apps and desktop apps. But we expect that for most apps (depending on codebase size, of course), migration will take on the order of days rather than weeks.
Nota
Your existing UWP app will continue to function as expected. However, to take advantage of modern features in WinUI 3 and the Windows App SDK we recommend migrating your app.
Below are the steps, at a high level, for migrating manually. But see the following section for info about using the .NET Upgrade Assistant tool).
Create a new WinUI 3 packaged desktop project (see Create your first WinUI 3 project). That could go into your project's existing solution.
Copy your XAML/UI code. In many cases you can simply change namespaces (for example, Windows.UI.* to Microsoft.UI.*).
Copy your app logic code. Some APIs need tweaks, such as Popup, Pickers, and SecondaryTiles.
For full details, see the topics in the table below. They describe and demonstrate how to manually migrate your Universal Windows Platform (UWP) application to the Windows App SDK.
Take particular note of What's supported when migrating from UWP to WinUI 3, which describes any functionality that's not yet supported in WinUI 3 and the Windows App SDK. If your app needs any of those features/libraries, then you might want to consider postponing migration.
Migrating by using the .NET Upgrade Assistant tool
As a further step in assisting you to migrate your UWP apps to the Windows App SDK and WinUI 3, we've leveraged the .NET Upgrade Assistant, adding support for migrating C# UWP apps. The UWP support automates much of the migration process. For more info, see the topic Migrate from UWP to the Windows App SDK with the .NET Upgrade Assistant.
Containerization benefits
When transitioning to the Windows App SDK, UWP applications might lose the inherent containerization benefits of their original platform. However, those benefits can be restored by using Win32 App Isolation—a new security feature that enhances protection by isolating applications within a sandbox environment. This approach offers additional security against potential threats with minimal changes to your existing code. For more info, and to begin using Win32 App Isolation, visit Welcome to the Win32 app isolation repo on GitHub.
Sumber untuk kandungan ini boleh didapati di GitHub, di mana anda juga boleh mencipta dan menyemak isu dan menarik permintaan. Untuk maklumat lanjut, lihat panduan penyumbang kami.
Windows developer maklum balas
Windows developer ialah projek sumber terbuka. Pilih pautan untuk memberikan maklum balas:
WinUI 3 and the Windows App SDK are new technologies and, when compared to UWP, there are some features that aren't supported. This topic provides information on which features are supported before you attempt migration.