Prepare to develop with WinUI 3

Page update date :
Page creation date :

Operating environment

Windows
  • Windows 11
Visual Studio
  • Visual Studio 2022 Version 17.12.3
.NET
  • .NET 8
WinUI
  • WinUI 3
Windows App SDK
  • 1.6.241114003

Prerequisites

In some cases, lower versions may also work.

Windows
  • Windows 10
  • Windows 11
Visual Studio
  • Visual Studio 2022 version 17.12 or later
.NET
  • .NET 8 or later
Windows App SDK
  • 1.6.241114003 or later

Install Visual Studio and set up WinUI

WinUI 3 development projects can be added with the Visual Studio installation. This section provides a simplified description of the Visual Studio installation process. For detailed instructions, please refer to the following Tips.

Launch the Visual Studio 2022 installer from the internet or media. It supports Community, Professional, or higher editions.

In the workload selection, select Windows Application Development.

If you want to use the program's publishing function, see . NET Desktop Development.

Now just start the installation. There are other screens, but I won't explain them until they create a project.

Once the installation is complete, create a new project.

There is a in the search item in the WinUI upper right, so when you select it, the WinUI 3 project template will be displayed, so select any template and create a project.

You can now develop applications using WinUI 3.

If you want to add a WinUI 3 development environment later

If you install Visual Studio first, you can add a WinUI 3 development environment later.

Start Visual Studio and select Tools > Get Tools and Features from the menu.

The same screen as when installing Visual Studio will be displayed, so check "Windows Application Development".

Enable developer mode

WinUI applications run in a security-enhanced environment unlike other desktop applications. Therefore, it cannot be run as it is. When you try to run it, you will see a dialog like the one below and you will be prompted to enable "Developer Mode". If you click the link, the setting screen will be displayed, so please enable "Developer Mode".

Even if you are not using Visual Studio, you can also enable or disable "Developer Mode" from the settings screen. Select "Settings" from the Start menu.

From the System menu, select For Developers.

There is a toggle for "For developers", so set it to "On". A note will be displayed, so select "Yes" to enable it.