A step-by-step guide to setting up your development environment for Windows UI development.
Welcome to the exciting world of Windows UI development with WinUI! This guide will walk you through the essential steps to get your development environment ready to build your very first application.
Prerequisites: Ensure you have administrative privileges on your Windows machine, as some installations require them.
Visual Studio is the primary IDE for developing Windows applications. We recommend using the latest stable version.
.NET desktop developmentUniversal Windows Platform developmentThe Windows Software Development Kit (SDK) provides the tools, libraries, and headers necessary to build Windows applications. Visual Studio often installs a suitable SDK version during the workload installation, but it's good to verify.
Tip: To check or install specific SDK versions, open Visual Studio Installer, click "Modify" on your Visual Studio installation, go to the "Individual components" tab, and search for "Windows 10 SDK" or "Windows 11 SDK". Ensure you have at least version 10.0.19041.0 or later.
WinUI 3 templates provide pre-configured project structures to quickly start building WinUI applications.
dotnet new install Microsoft.WinUI.ProjectTemplates::2.7.0-prerelease.220923001
(Note: The version number might be slightly different for the latest stable release. Refer to the official WinUI documentation for the most current version.)
Important: If you encounter issues with the command, ensure your .NET SDK is up to date and that you have run the command prompt as an administrator.
Let's create a simple WinUI project to confirm everything is set up correctly.
F5 or click the "Start" button to build and run your application. You should see a basic blank window.
Congratulations! You have successfully set up your development environment for WinUI and built your first application. You are now ready to explore the possibilities of building modern, beautiful Windows applications.