Edit

Share via


Visual Studio for Windows app development

Visual Studio is the recommended IDE for building Windows apps with WinUI and the Windows App SDK. It provides deep integration with the Windows platform and tools purpose-built for XAML-based app development.

Key features for Windows app developers include:

  • XAML Hot Reload — modify XAML markup while your app is running and see changes applied instantly without restarting
  • XAML Live Visual Tree — inspect the runtime visual tree of your running app to debug layout issues and understand element hierarchy
  • IntelliSense for XAML and C#/C++ — get code completion, quick info, and error highlighting for both markup and code-behind
  • Integrated debugging — set breakpoints in XAML and code, inspect data bindings, and diagnose UI rendering issues

To get started, see Start developing Windows apps.

WinUI project templates

Visual Studio includes project templates to help you quickly create WinUI apps. To find them, open File > New > Project, then filter by WinUI in the project type drop-down or search for WinUI.

WinUI project templates

Blank App (Packaged)

Creates a desktop app in C# (.NET) or C++ (Win32) with a WinUI-based UI. The project starts with a single window derived from Microsoft.UI.Xaml.Window, ready for you to add your own controls and pages. This is the recommended starting point for most new apps. For a walkthrough, see Start developing Windows apps.

Blank App (Packaged with WAP Project)

Same as the Blank App template above, but adds a separate Windows Application Packaging Project to the solution. This project handles building your app into an MSIX package for distribution. If you prefer a simpler setup, you can use single-project MSIX instead to avoid maintaining the separate packaging project.

Component and test templates

These templates create libraries and test projects that work alongside a WinUI app.

Template Language Description
Class Library C# A .NET class library (DLL) for sharing code across WinUI apps.
Windows Runtime Component C++ A Windows Runtime component written in C++/WinRT that can be consumed by any app with a WinUI-based UI, regardless of programming language.
Unit Test App C# and C++ An MSTest project for writing and running automated tests against your app.

WinUI item templates

Item templates let you add new files to an existing WinUI project. Right-click your project in Solution Explorer, select Add > New Item, and choose the WinUI tab.

WinUI item templates

Template Language Description
Blank Page C# and C++ Adds a XAML file and code file that defines a new page derived from the Microsoft.UI.Xaml.Controls.Page class.
Blank Window C# and C++ Adds a XAML file and code file that defines a new window derived from the Microsoft.UI.Xaml.Window class.
Resource Dictionary C# and C++ Adds an empty, keyed collection of XAML resources. For more information, see ResourceDictionary and XAML resource references.
Resources File (.resw) C# and C++ Adds a file for storing string and conditional resources for your app. You can use this item to help localize your app. For more info, see Localize strings in your UI and app package manifest.
Templated Control C# and C++ Adds a code file for creating a templated control with a default style. The templated control is derived from the Microsoft.UI.Xaml.Controls.Control class.

For a walkthrough that demonstrates how to use this item template, see Build XAML templated controls. For more information about templated controls, see Custom XAML Controls.
User Control C# and C++ Adds a XAML file and code file for creating a user control that derives from the Microsoft.UI.Xaml.Controls.UserControl class. Typically, a user control encapsulates related existing controls and provide its own logic.

For more information about user controls, see Custom XAML Controls.

See also