|
1 | 1 | --- |
2 | | -title: WinUI templates in Visual Studio |
3 | | -description: Once you've set up your development computer, you're ready to create a WinUI app by starting from one of the WinUI project templates in Visual Studio. This topic describes the available project and item templates. |
4 | | -keywords: windows 10, windows 11, Windows App SDK, Windows app development platform, desktop development, win32, WinRT, uwp, toolkit sdk, winui |
5 | | -ms.date: 07/09/2024 |
| 2 | +title: Visual Studio for Windows app development |
| 3 | +description: Visual Studio is the recommended IDE for building Windows apps with WinUI and the Windows App SDK. Learn about key features and available project templates. |
| 4 | +keywords: windows 10, windows 11, Windows App SDK, Windows app development platform, desktop development, win32, WinRT, uwp, toolkit sdk, winui, visual studio |
| 5 | +ms.date: 03/03/2026 |
6 | 6 | ms.topic: article |
7 | 7 | --- |
8 | 8 |
|
9 | | -# WinUI templates in Visual Studio |
| 9 | +# Visual Studio for Windows app development |
10 | 10 |
|
11 | | -Once you've set up your development computer (see [Start developing Windows apps](../../get-started/start-here.md)), you're ready to create a WinUI app by starting from one of the project templates in Visual Studio. This topic describes the available project and item templates. |
| 11 | +[Visual Studio](https://visualstudio.microsoft.com/) is the recommended IDE for building Windows apps with [WinUI](/windows/apps/winui/) and the [Windows App SDK](/windows/apps/windows-app-sdk/). It provides deep integration with the Windows platform and tools purpose-built for XAML-based app development. |
12 | 12 |
|
13 | | -To access the WinUI project templates, in the **New Project** dialog's drop-down filters, select **WinUI** in the project type drop-down. Alternatively, you can search for *WinUI*, and select one of the available C# or C++ templates. |
| 13 | +Key features for Windows app developers include: |
14 | 14 |
|
15 | | -:::image type="content" source="images/WinUI3-csharp-newproject-1.0-later.png" alt-text="WinUI project templates" border="true"::: |
| 15 | +- **XAML Hot Reload** — modify XAML markup while your app is running and see changes applied instantly without restarting |
| 16 | +- **XAML Live Visual Tree** — inspect the runtime visual tree of your running app to debug layout issues and understand element hierarchy |
| 17 | +- **IntelliSense for XAML and C#/C++** — get code completion, quick info, and error highlighting for both markup and code-behind |
| 18 | +- **Integrated debugging** — set breakpoints in XAML and code, inspect data bindings, and diagnose UI rendering issues |
| 19 | + |
| 20 | +To get started, see [Start developing Windows apps](../../get-started/start-here.md). |
16 | 21 |
|
17 | | -## Project templates for WinUI |
| 22 | +## WinUI project templates |
18 | 23 |
|
19 | | -You can use these WinUI project templates to start creating an app. |
| 24 | +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*. |
20 | 25 |
|
21 | | -### WinUI Blank App (Packaged) |
| 26 | +:::image type="content" source="images/WinUI3-csharp-newproject-1.0-later.png" alt-text="WinUI project templates" border="true"::: |
22 | 27 |
|
23 | | -This project template creates a desktop .NET (C#) or native Win32 (C++) app with a WinUI-based user interface. The generated project includes a basic window that derives from the **Microsoft.UI.Xaml.Window** class in the WinUI library that you can use to start building your UI. For more information about using this project template, see [Start developing Windows apps](../../get-started/start-here.md). |
| 28 | +### Blank App (Packaged) |
24 | 29 |
|
25 | | -### WinUI Blank App (Packaged with Windows Application Packaging Project) |
| 30 | +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](../../get-started/start-here.md). |
26 | 31 |
|
27 | | -This project template creates a desktop .NET (C#) or native Win32 (C++) app with a WinUI-based user interface. The generated project includes a basic window that derives from the **Microsoft.UI.Xaml.Window** class in the WinUI library that you can use to start building your UI. |
| 32 | +### Blank App (Packaged with WAP Project) |
28 | 33 |
|
29 | | -The solution also includes a separate [Windows Application Packaging Project](/windows/msix/desktop/desktop-to-uwp-packaging-dot-net) that is configured to build the app into an [MSIX package](/windows/msix/overview). You can optionally install the [single-project MSIX packaging tools extension for Visual Studio](../../windows-app-sdk/single-project-msix.md) and combine the packaging project settings into your application project so you no longer need to maintain a separate packaging project. |
| 34 | +Same as the Blank App template above, but adds a separate [Windows Application Packaging Project](/windows/msix/desktop/desktop-to-uwp-packaging-dot-net) to the solution. This project handles building your app into an [MSIX package](/windows/msix/overview) for distribution. If you prefer a simpler setup, you can use [single-project MSIX](../../windows-app-sdk/single-project-msix.md) instead to avoid maintaining the separate packaging project. |
30 | 35 |
|
31 | | -### WinUI project templates for other components |
| 36 | +### Component and test templates |
32 | 37 |
|
33 | | -You can use these WinUI project templates to build components that can be loaded and used by a WinUI-based app. |
| 38 | +These templates create libraries and test projects that work alongside a WinUI app. |
34 | 39 |
|
35 | 40 | | Template | Language | Description | |
36 | 41 | |----------|----------|-------------| |
37 | | -| WinUI Class Library | C# only | Creates a .NET managed class library (DLL) in C# that can be used by other .NET desktop apps with a WinUI-based user interface. | |
38 | | -| Windows Runtime Component (WinUI) | C++ only | Creates a [Windows Runtime component](/windows/uwp/winrt-components/) written in C++/WinRT that can be consumed by any UWP or desktop app with a WinUI-based user interface, regardless of the programming language in which the app is written. | |
39 | | -| WinUI Unit Test App | C#/C++ | Creates a unit test project using MSTest to help you write and run automated tests for your app. | |
| 42 | +| **Class Library** | C# | A .NET class library (DLL) for sharing code across WinUI apps. | |
| 43 | +| **Windows Runtime Component** | C++ | A [Windows Runtime component](/windows/uwp/winrt-components/) written in C++/WinRT that can be consumed by any app with a WinUI-based UI, regardless of programming language. | |
| 44 | +| **Unit Test App** | C# and C++ | An MSTest project for writing and running automated tests against your app. | |
40 | 45 |
|
41 | | -## Item templates for WinUI |
| 46 | +## WinUI item templates |
42 | 47 |
|
43 | | -The following item templates are available for use in a WinUI project. To access these WinUI item templates, right-click the project node in **Solution Explorer**, select **Add** -> **New item**, and click **WinUI** in the **Add New Item** dialog. |
| 48 | +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. |
44 | 49 |
|
45 | 50 |  |
46 | 51 |
|
47 | 52 | | Template | Language | Description | |
48 | 53 | |----------|----------|-------------| |
49 | | -| 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. | |
50 | | -| 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. | |
51 | | -| Resource Dictionary | C# and C++ | Adds an empty, keyed collection of XAML resources. For more information, see [ResourceDictionary and XAML resource references](../../develop/platform/xaml/xaml-resource-dictionary.md). | |
52 | | -| 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](/windows/uwp/app-resources/localize-strings-ui-manifest). | |
53 | | -| 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.<p></p>For a walkthrough that demonstrates how to use this item template, see [Templated XAML controls for UWP and WinUI apps with C++/WinRT](xaml-templated-controls-cppwinrt-winui-3.md) and [Templated XAML controls for UWP and WinUI apps with C#](xaml-templated-controls-csharp-winui-3.md). For more information about templated controls, see [Custom XAML Controls](/archive/msdn-magazine/2019/may/xaml-custom-xaml-controls). | |
54 | | -| 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.<p></p>For more information about user controls, see [Custom XAML Controls](/archive/msdn-magazine/2019/may/xaml-custom-xaml-controls). | |
| 54 | +| **Blank Page** | C# and C++ | A new XAML page derived from **Microsoft.UI.Xaml.Controls.Page**. | |
| 55 | +| **Blank Window** | C# and C++ | A new window derived from **Microsoft.UI.Xaml.Window**. | |
| 56 | +| **Resource Dictionary** | C# and C++ | An empty, keyed collection of XAML resources. See [ResourceDictionary and XAML resource references](../../develop/platform/xaml/xaml-resource-dictionary.md). | |
| 57 | +| **Resources File (.resw)** | C# and C++ | A string resource file for localizing your app. See [Localize strings in your UI and app package manifest](/windows/uwp/app-resources/localize-strings-ui-manifest). | |
| 58 | +| **Templated Control** | C# and C++ | A lookless control derived from **Microsoft.UI.Xaml.Controls.Control** with a default style. See the walkthroughs for [C++/WinRT](xaml-templated-controls-cppwinrt-winui-3.md) and [C#](xaml-templated-controls-csharp-winui-3.md). | |
| 59 | +| **User Control** | C# and C++ | A composite control derived from **Microsoft.UI.Xaml.Controls.UserControl** that groups existing controls with custom logic. See [Custom XAML Controls](/archive/msdn-magazine/2019/may/xaml-custom-xaml-controls). | |
55 | 60 |
|
56 | 61 | ## See also |
57 | 62 |
|
|
0 commit comments