If you have a desktop project in which you want to use the Windows App SDK, then you can install the Windows App SDK NuGet package in your project (the latest version, or any version that you need). Unpackaged apps (that is, apps that don't use MSIX for their deployment technology) must follow this procedure if they're to use the Windows App SDK. But packaged apps can do it, too.
If you have a C# desktop project, then make sure that the TargetFramework element in the project file is set to a Windows 10-specific moniker (such as net6.0-windows10.0.19041.0) so that you can call Windows Runtime APIs. For more info, see Call Windows Runtime APIs in desktop apps. Additionally, you must be targeting 18362 or later, since there's a known issue blocking apps that target 17763 (see Build errors when using TFM of 17763 on GitHub).
Make sure that PackageReference is selected for Default package management format.
Right-click your project in Solution Explorer, and choose Manage NuGet Packages.
In the NuGet Package Manager window, select the Include prerelease check box near the top of the window, select the Browse tab, and search for one of the following packages:
To install one of the 1.0 or later releases, search for the Microsoft.WindowsAppSDK package.
To install one of the 0.8 releases, search for the Microsoft.ProjectReunion package.
After you've found the appropriate Windows App SDK NuGet package, select the package, and click Install in the right-hand pane of the NuGet Package Manager window.
Note
The Windows App SDK NuGet package contains other sub-packages (including Microsoft.WindowsAppSDK.Foundation, Microsoft.WindowsAppSDK.WinUI, and others) that contain the implementations for specific components in the Windows App SDK. You can't install these sub-packages individually in order to reference only certain components in your project. You must install the main Windows App SDK NuGet package, which includes all of the components.
Your app can now use Windows App SDK APIs and components that are available in the release channel that you installed. For the list of available features, see release channels.
Further info
If your existing project is a C++ project, and you want to call Windows Runtime APIs in the Windows App SDK, then you'll need to add support for C++/WinRT. See Visual Studio support for C++/WinRT, XAML, the VSIX extension, and the NuGet package. Look for info there about the Microsoft.Windows.CppWinRT NuGet package. Without that package, your project won't be able to find the namespace header files for Windows Runtime APIs in the Windows App SDK.
If you encounter a Class not registered error when you try to use a Windows App SDK component, then you might have to add to your project a dynamic dependency on the Windows App SDK Framework package. For more info, see MSIX framework packages and dynamic dependencies.
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Windows developer feedback
Windows developer is an open source project. Select a link to provide feedback:
Create a .NET project and learn to add packages and manage package dependencies in your project. Use the .NET Core CLI and NuGet registry to add libraries and tools to your C# applications through Visual Studio Code.