Migrate from UWP to the Windows App SDK

To migrate your app from UWP to the Windows App SDK, the UI code likely needs just a few namespace changes while much of the platform code can stay the same.

Note

There's no need to migrate your project if the functionality currently supported by the Universal Windows Platform (UWP) is sufficient as Windows UI Library (WinUI) 2, and the Windows SDK, support UWP project types.

Even though you might need to adjust some code due to differences between desktop apps and UWP apps, migrating most apps requires just a few steps.

  1. Create your first WinUI 3 (Windows App SDK) project packaged desktop project (this could go into your app's existing solution).
  2. Copy your XAML/UI code. In many cases you can simply change namespaces (for example, Windows.UI.* to Microsoft.UI.*).
  3. Copy your app logic code. Some APIs need tweaks, such as Popup, Pickers, and SecondaryTiles.

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, you might want to consider postponing migration.

Note

If your UWP source code is written in C++/CX, you will need to port that code (see Move to C++/WinRT from C++/CX).

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.

Topics in this section

Topic Description
Overall migration strategy Considerations and strategies for approaching the migration process, and how to set up your development environment for migrating.
Mapping UWP features to the Windows App SDK This topic compares major feature areas in the different forms in which they appear in UWP and in the Windows App SDK.
What's supported Learn what features are currently available in WinUI 3 Desktop to evaluate whether you should attempt migrating your UWP app today.
Mapping UWP APIs and libraries to Windows App SDK This topic provides a mapping of UWP APIs and libraries to their Windows App SDK equivalents.
Feature area guides A collection of migration guidance topics, each focusing on a specific feature area.
Case study 1—PhotoLab (C#) This topic is a case study of taking the C# UWP PhotoLab sample app, and migrating it to the Windows App SDK.
Case study 2—Photo Editor (C++/WinRT) This topic is a case study of taking the C++/WinRT UWP Photo Editor sample app, and migrating it to the Windows App SDK.
Additional migration guidance This topic contains additional migration guidance not categorized into a feature area in the feature area guides.
Migrate from UWP to the Windows App SDK with the .NET Upgrade Assistant The .NET Upgrade Assistant is a command-line tool that can assist with migrating a C# UWP app to a Windows UI Library (WinUI) 3 app that uses the Windows App SDK.