You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: hub/apps/get-started/start-here.md
+33-83Lines changed: 33 additions & 83 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,12 +8,9 @@ ms.localizationpriority: medium
8
8
ms.collection: windows11
9
9
---
10
10
11
-
# Start developing Windows apps
11
+
# Setup and tooling for WinUI
12
12
13
-
Welcome to Windows app development. This guide takes you through the steps needed to begin creating apps by using the latest Windows development frameworks: the Windows App SDK and WinUI. It also points you to resources that help you learn more about Windows development. For a step-by-step guide to setting up your developer environment and building your first WinUI app with the latest tools, see [WinUI 101](/training/modules/winui-101/). If you're already comfortable developing apps for Windows but want to know more about the latest tools, see [Develop Windows desktop apps](/windows/apps/develop/).
14
-
15
-
> [!TIP]
16
-
> [Microsoft Copilot](https://copilot.microsoft.com) is a great resource if you have questions about getting started writing Windows apps.
13
+
Welcome to Windows app development. This guide will take you through the steps needed to begin creating your first app with WinUI. It will also point you to resources that will help you learn more about Windows development. If you want a step-by-step guide to setting up your developer environment and building your first WinUI app with the latest tools, please see [WinUI 101](/training/modules/winui-101/).
17
14
18
15
19
16
## 1. Enable Developer Mode
@@ -25,54 +22,57 @@ Windows has a special mode for developers that adjusts security settings so you
25
22
26
23
To enable Developer Mode:
27
24
28
-
* Open Windows Settings and go to the **[System > For developers](ms-settings:developers)** page.
29
-
* Toggle the Developer Mode switch to **On** and confirm your choice in the confirmation dialog.
25
+
* Open Windows Settings and navigate to the **[System > Advanced](ms-settings:developers)** page.
26
+
* Toggle the **Developer Mode** switch to **On** and confirm your choice in the confirmation dialog.
30
27
31
28
For more information about Developer Mode, see [Enable your device for development](/windows/apps/get-started/enable-your-device-for-development).
32
29
33
30
34
-
## 2. Install Visual Studio
31
+
## 2. Install Visual Studio and required workloads
35
32
36
-
Use [Visual Studio](/visualstudio/ide/), Microsoft's comprehensive integrated development environment (IDE), to create your WinUI app. It's the preferred development tool of many Windows developers and it helps you write, debug, and deploy your apps. The project templates in Visual Studio quickly get you started with projects for Windows and many other platforms.
33
+
Use [Visual Studio](/visualstudio/ide/), Microsoft’s powerful IDE, to build, debug, and deploy your WinUI app. It offers ready-to-use project templates for Windows and other platforms to help you get started quickly.
37
34
38
-
> [!TIP]
39
-
> Before installing these tools, make sure your development computer meets the [system requirements for Windows app development](../windows-app-sdk/system-requirements.md).
35
+
The free **Visual Studio Community Edition** includes everything you need to develop apps. Larger teams or enterprises may require **Professional** or **Enterprise** editions. Learn more in [What is Visual Studio?](/visualstudio/get-started/visual-studio-ide) and [system requirements for Windows app development](../windows-app-sdk/system-requirements.md).
36
+
37
+
#### [WinGet](#tab/winget)
38
+
39
+
Install the required tools and workloads by running one of the following commands in the console.
40
+
The command opens the Visual Studio Installer with any missing workloads preselected — just choose **Modify** to install them.
41
+
42
+
If you prefer, you can replace *Community* with *Professional* or *Enterprise* to install those editions instead.
43
+
44
+
**For C# app development**
45
+
```console
46
+
winget install "Visual Studio Community 2022" --override "--add Microsoft.VisualStudio.Workload.ManagedDesktop Microsoft.VisualStudio.ComponentGroup.WindowsAppSDK.Cs" -s msstore
47
+
```
48
+
49
+
**For C++ app development**
50
+
```console
51
+
winget install "Visual Studio Community 2022" --override "--add Microsoft.VisualStudio.Workload.NativeDesktop Microsoft.VisualStudio.ComponentGroup.WindowsAppSDK.Cpp" -s msstore
52
+
```
53
+
54
+
#### [Manual installation](#tab/manual)
40
55
41
56
Use the following link to download and install the latest Visual Studio. The installer walks you through the steps, but if you need detailed instructions, see [Install Visual Studio](/visualstudio/install/install-visual-studio).
The free Visual Studio Community Edition includes everything you need to create your apps. If you're working with a development team or enterprise, you might need Visual Studio Professional or Visual Studio Enterprise. See [What is Visual Studio?](/visualstudio/get-started/visual-studio-ide) for more info.
47
-
48
-
### 2.2 Required workloads and components
61
+
#### Required workloads and components
49
62
50
63
While installing Visual Studio, install the workloads and components required for developing with WinUI and the Windows App SDK. After installation, you can open the Visual Studio Installer app and select **Modify** to add workloads and components.
51
64
52
65
On the **Workloads** tab of the Visual Studio Installer app, select the following workloads and components:
53
66
54
-
#### [Visual Studio 2022 version 17.10 and later](#tab/vs-2022-17-10)
55
-
56
-
* For **C#** app development using the Windows App SDK, select **WinUI application development**.
67
+
***For C# app development** using the Windows App SDK, select **WinUI application development**.
57
68
58
69
:::image type="content" source="images/hello-world/vs-workload-winui.png" alt-text="A screenshot of the Visual Studio installer UI with the WinUI application development workload selected.":::
59
70
60
-
* For **C++** app development using the Windows App SDK, select **WinUI application development**.
61
-
* Then in the **Installation details** pane, under the **WinUI application development** node, select **C++ WinUI app development tools**. (This selection also includes any additional required components.)
62
-
63
-
:::image type="content" source="images/hello-world/vs-workload-winui-cpp.png" alt-text="A screenshot of the Visual Studio installer UI with the C++ WinUI app development tools selected.":::
71
+
***For C++ app development**, select the **C++ WinUI app development tools** under the **WinUI application development** node in the **Installation details** pane (This will also select any additional required components.)
64
72
65
73
> [!NOTE]
66
74
> _In Visual Studio 17.10 - 17.12, this workload is called **Windows application development**._
67
75
68
-
#### [Visual Studio 2022 version 17.1 - 17.9](#tab/vs-2022-17-1)
69
-
70
-
* For **C#** app development using the Windows App SDK, select **.NET Desktop Development**.
71
-
* Then in the **Installation details** pane of the installation dialog box, select **Windows App SDK C# Templates** (near the bottom of the list).
72
-
* For **C++** app development using the Windows App SDK, select **Desktop development with C++**
73
-
* Then in the **Installation details** pane of the installation dialog box, select **Windows App SDK C++ Templates** (at the bottom of the list).
74
-
* On the **Individual components** tab of the installation dialog box, in the **SDKs, libraries, and frameworks** section, make sure the latest Windows SDK is selected. It looks like **Windows 11 SDK (10.0.22621.0)**. Type "Windows SDK" into the search box to make it easier to find.
75
-
76
76
---
77
77
78
78
## 3. Create and launch your first WinUI app
@@ -95,67 +95,17 @@ To create a new project by using the WinUI C# Blank App project template:
95
95
96
96
1. Select the **Debug** "Start" button to build and run your project:<br/>
97
97
:::image type="content" source="images/hello-world/start-click.png" alt-text="Build and run your project":::<br/>
98
-
Your project builds, deploys to your local machine, and runs in debug mode:<br/>
99
-
:::image type="content" source="images/hello-world/click-me.png" alt-text="Hello World project built and running":::
98
+
Your project will build, be deployed to your local machine, and run in debug mode:<br/>
99
+
:::image type="content" source="images/hello-world/click-me.png" border="false" alt-text="Hello World project built and running":::
100
100
101
101
1. To stop debugging, close the app window, or select the debug "Stop" button in Visual Studio.
102
102
103
-
## 4. Delete sample code
104
-
105
-
The `MainWindow` class included with the project template contains sample code that you need to remove to make room for your content.
106
-
107
-
1. Double-click `MainWindow.xaml` in **Solution Explorer** to open it. You should see XAML markup for a `StackPanel` control.
108
-
1. Delete the XAML for the `StackPanel`. (You'll add your own content in its place as you create your app.)
If you try to run your app now, Visual Studio throws an error along the lines of `The name 'myButton' does not exist in the current context`. This error occurs because you deleted the `Button` control named `myButton`, but the `MainPage.xaml.cs` code-behind file still references it. Delete the reference in the code file, too.
118
-
119
-
1. Double-click `MainWindow.xaml.cs` in **Solution Explorer** to open it.
1. Save the file by pressing <kbd>CTRL + SHIFT + S</kbd>, clicking the **Save All** icon in the tool bar, or by selecting the menu **File** > **Save All**.
140
-
141
-
## 5. Update to the latest WinUI/Windows App SDK
142
-
143
-
The Windows App SDK (and WinUI, which is part of it) is distributed as a [NuGet](/nuget/what-is-nuget) package. This distribution method means updates can be released out-of-sync with Windows and Visual Studio. As a result, the Visual Studio template you used to create your project might not reference the latest Windows App SDK NuGet package. To ensure you have the latest features and fixes, update your NuGet packages every time you create a new project in Visual Studio.
144
-
145
-
To update the Windows App SDK NuGet package for your project:
146
-
147
-
* In Visual Studio, with your project loaded, select **Tools** > **NuGet Package Manager** > **Manage NuGet Packages for Solution...**.
148
-
* If an update is available, it appears on the **Updates** page. Check the box next to the listed update. (To include prerelease updates, check the **Include prerelease** option. To learn more about what's included in an update, see the [release notes](../windows-app-sdk/stable-channel.md).)
149
-
* Select **Update**, then select **Apply** in the **Preview changes** dialog. Accept the license terms to finish installing the update.
150
-
151
-
:::image type="content" source="images/hello-world/nuget-update.png" alt-text="A screenshot of the NuGet package manager in Visual Studio showing a Windows App SDK package update.":::
152
-
153
-
Now your project uses the latest WinUI features, and it's ready for you to make it your own.
103
+
Congratulations, you've just built your first WinUI app! Continue with the next steps below to explore more.
154
104
155
105
## Next steps
156
106
157
107
> [!div class="nextstepaction"]
158
-
> [Complete a tutorial to create a note app with WinUI](../tutorials/winui-notes/intro.md)
108
+
> [Build your first notetaking app with WinUI](../tutorials/winui-notes/intro.md)
159
109
160
110
* To get an idea of what WinUI offers, check out the WinUI Gallery app.
0 commit comments