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
If you haven't downloaded and installed Visual Studio and the Microsoft C/C++ tools yet, here's how to get started.
13
13
14
+
::: moniker range="msvc-170"
15
+
16
+
## Visual Studio 2022 Installation
17
+
18
+
Welcome to Visual Studio 2022! In this version, it's easy to choose and install just the features you need. And because of its reduced minimum footprint, it installs quickly and with less system impact.
19
+
20
+
> [!NOTE]
21
+
> This topic applies to installation of Visual Studio on Windows. [Visual Studio Code](https://code.visualstudio.com/) is a lightweight, cross-platform development environment that runs on Windows, Mac, and Linux systems. The Microsoft [C/C++ for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools) extension supports IntelliSense, debugging, code formatting, auto-completion. Visual Studio for Mac doesn't support Microsoft C++, but does support .NET languages and cross-platform development. For installation instructions, see [Install Visual Studio for Mac](/visualstudio/mac/installation/).
22
+
23
+
Want to know more about what else is new in this version? See the Visual Studio [release notes](/visualstudio/releases/2022/release-notes/).
24
+
25
+
Ready to install? We'll walk you through it, step-by-step.
26
+
27
+
### Step 1 - Make sure your computer is ready for Visual Studio
28
+
29
+
Before you begin installing Visual Studio:
30
+
31
+
1. Check the [system requirements](/visualstudio/releases/2022/system-requirements). These requirements help you know whether your computer supports Visual Studio 2022.
32
+
33
+
1. Apply the latest Windows updates. These updates ensure that your computer has both the latest security updates and the required system components for Visual Studio.
34
+
35
+
1. Reboot. The reboot ensures that any pending installs or updates don't hinder the Visual Studio install.
36
+
37
+
1. Free up space. Remove unneeded files and applications from your %SystemDrive% by, for example, running the Disk Cleanup app.
38
+
39
+
For questions about running previous versions of Visual Studio side by side with Visual Studio 2022, see the [Visual Studio 2022 Platform Targeting and Compatibility](/visualstudio/releases/2022/compatibility/) page.
40
+
41
+
### Step 2 - Download Visual Studio
42
+
43
+
Next, download the Visual Studio bootstrapper file. To do so, choose the following button to go to the Visual Studio download page. Select the edition of Visual Studio that you want and choose the **Free trial** or **Free download** button.
Run the bootstrapper file you downloaded to install the Visual Studio Installer. This new lightweight installer includes everything you need to both install and customize Visual Studio.
51
+
52
+
1. From your **Downloads** folder, double-click the bootstrapper that matches or is similar to one of the following files:
53
+
54
+
-**vs_community.exe** for Visual Studio Community
55
+
-**vs_professional.exe** for Visual Studio Professional
56
+
-**vs_enterprise.exe** for Visual Studio Enterprise
57
+
58
+
If you receive a User Account Control notice, choose **Yes** to allow the bootstrapper to run.
59
+
60
+
1. We'll ask you to acknowledge the Microsoft [License Terms](https://visualstudio.microsoft.com/license-terms/) and the Microsoft [Privacy Statement](https://privacy.microsoft.com/privacystatement). Choose **Continue**.
61
+
62
+
### Step 4 - Choose workloads
63
+
64
+
After the installer is installed, you can use it to customize your installation by selecting the *workloads*, or feature sets, that you want. Here's how.
65
+
66
+
1. Find the workload you want in the **Installing Visual Studio** screen.
67
+
68
+

69
+
70
+
For core C and C++ support, choose the "Desktop development with C++" workload. It comes with the default core editor, which includes basic code editing support for over 20 languages, the ability to open and edit code from any folder without requiring a project, and integrated source code control.
71
+
72
+
Additional workloads support other kinds of development. For example, choose the "Universal Windows Platform development" workload to create apps that use the Windows Runtime for the Microsoft Store. Choose "Game development with C++" to create games that use DirectX, Unreal, and Cocos2d. Choose "Linux development with C++" to target Linux platforms, including IoT development.
73
+
74
+
The **Installation details** pane lists the included and optional components installed by each workload. You can select or deselect optional components in this list. For example, to support development by using the Visual Studio 2017 or 2015 compiler toolsets, choose the MSVC v141 or MSVC v140 optional components. You can add support for MFC, the experimental Modules language extension, IncrediBuild, and more.
75
+
76
+
1. After you choose the workload(s) and optional components you want, choose **Install**.
77
+
78
+
Next, status screens appear that show the progress of your Visual Studio installation.
79
+
80
+
> [!TIP]
81
+
> At any time after installation, you can install workloads or components that you didn't install initially. If you have Visual Studio open, go to **Tools** > **Get Tools and Features...** which opens the Visual Studio Installer. Or, open **Visual Studio Installer** from the Start menu. From there, you can choose the workloads or components that you wish to install. Then, choose **Modify**.
If you don't want to use the Workloads feature to customize your Visual Studio installation, or you want to add more components than a workload installs, you can do so by installing or adding individual components from the **Individual components** tab. Choose what you want, and then follow the prompts.
86
+
87
+
### Step 6 - Install language packs (Optional)
88
+
89
+
By default, the installer program tries to match the language of the operating system when it runs for the first time. To install Visual Studio in a language of your choosing, choose the **Language packs** tab from the Visual Studio Installer, and then follow the prompts.
90
+
91
+

92
+
93
+
#### Change the installer language from the command line
94
+
95
+
Another way that you can change the default language is by running the installer from the command line. For example, you can force the installer to run in English by using the following command: `vs_installer.exe --locale en-US`. The installer will remember this setting when it's run the next time. The installer supports the following language tokens: zh-cn, zh-tw, cs-cz, en-us, es-es, fr-fr, de-de, it-it, ja-jp, ko-kr, pl-pl, pt-br, ru-ru, and tr-tr.
96
+
97
+
### Step 7 - Change the installation location (Optional)
98
+
99
+
You can reduce the installation footprint of Visual Studio on your system drive. You can choose to move the download cache, shared components, SDKs, and tools to different drives, and keep Visual Studio on the drive that runs it the fastest.
100
+
101
+
> [!IMPORTANT]
102
+
> You can select a different drive only when you first install Visual Studio. If you've already installed it and want to change drives, you must uninstall Visual Studio and then reinstall it.
103
+
104
+
### Step 8 - Start developing
105
+
106
+
1. After Visual Studio installation is complete, choose the **Launch** button to get started developing with Visual Studio.
107
+
108
+
1. On the start window, choose **Create a new project**.
109
+
110
+
1. In the search box, enter the type of app you want to create to see a list of available templates. The list of templates depends on the workload(s) that you chose during installation. To see different templates, choose different workloads.
111
+
112
+
You can also filter your search for a specific programming language by using the **Language** drop-down list. You can filter by using the **Platform** list and the **Project type** list, too.
113
+
114
+
1. Visual Studio opens your new project, and you're ready to code!
Copy file name to clipboardExpand all lines: docs/cppcx/casting-c-cx.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -50,7 +50,7 @@ Use safe_cast if the code does not declare the relationship but you are sure tha
50
50
51
51
## dynamic_cast
52
52
53
-
Use **`dynamic_cast`** when you cast an object (more specifically, a hat **^**) to a more derived type, you expect either that the target object might sometimes be **`nullptr`** or that the cast might fail, and you want to handle that condition as a regular code path instead of an exception. For example, in the **Blank App (Universal Windows)** project template, the `OnLaunched` method in app.xamp.cpp uses **`dynamic_cast`** to test whether the app window has content. It's not an error if it doesn’t have content; it is an expected condition. `Windows::Current::Content` is a `Windows::UI::XAML::UIElement` and the conversion is to a `Windows::UI.XAML::Controls::Frame`, which is a more derived type in the inheritance hierarchy.
53
+
Use **`dynamic_cast`** when you cast an object (more specifically, a hat **^**) to a more derived type, you expect either that the target object might sometimes be **`nullptr`** or that the cast might fail, and you want to handle that condition as a regular code path instead of an exception. For example, in the **Blank App (Universal Windows)** project template, the `OnLaunched` method in app.xaml.cpp uses **`dynamic_cast`** to test whether the app window has content. It's not an error if it doesn’t have content; it is an expected condition. `Windows::Current::Content` is a `Windows::UI::XAML::UIElement` and the conversion is to a `Windows::UI.XAML::Controls::Frame`, which is a more derived type in the inheritance hierarchy.
If you use **`reinterpret_cast`** to convert from oneWindows Runtime interface to another, you cause the object to be released twice. Therefore, only use this cast when you are converting to a non-C++ component extensions interface.
90
+
If you use **`reinterpret_cast`** to convert from one Windows Runtime interface to another, you cause the object to be released twice. Therefore, only use this cast when you are converting to a non-C++ component extensions interface.
Copy file name to clipboardExpand all lines: docs/get-started/tutorial-console-cpp.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -21,9 +21,9 @@ The usual starting point for a C++ programmer is a "Hello, world!" application t
21
21
22
22
Visual Studio uses *projects* to organize the code for an app, and *solutions* to organize your projects. A project contains all the options, configurations, and rules used to build your apps. It also manages the relationship between all the project's files and any external files. To create your app, first, you'll create a new project and solution.
23
23
24
-
1. If you've just started Visual Studio, you'll see the Visual Studio 2019 dialog box. Choose **Create a new project** to get started.
24
+
1. If you've just started Visual Studio, you'll see the Visual Studio Start dialog box. Choose **Create a new project** to get started.
25
25
26
-

26
+

27
27
28
28
Otherwise, on the menubar in Visual Studio, choose **File** > **New** > **Project**. The **Create a new project** window opens.
Copy file name to clipboardExpand all lines: docs/overview/cpp-conformance-improvements.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -10,9 +10,9 @@ Microsoft C/C++ in Visual Studio (MSVC) makes conformance improvements and bug f
10
10
11
11
This document lists the changes in Visual Studio 2022. For a guide to the changes in Visual Studio 2019, see [C++ conformance improvements in Visual Studio 2019](cpp-conformance-improvements-2019.md). For changes in Visual Studio 2017, see [C++ conformance improvements in Visual Studio 2017](cpp-conformance-improvements-2017.md). For a complete list of previous conformance improvements, see [Visual C++ What's New 2003 through 2015](../porting/visual-cpp-what-s-new-2003-through-2015.md).
12
12
13
-
## <aname="improvements_170_preview"></a> Conformance improvements in Visual Studio 2022 Preview and RC (version 17.0)
13
+
## <aname="improvements_170_preview"></a> Conformance improvements in Visual Studio 2022 version 17.0
14
14
15
-
Visual Studio 2022 Preview and RC version 17.0 contains the following conformance improvements, bug fixes, and behavior changes in the Microsoft C++ compiler.
15
+
Visual Studio 2022 version 17.0 contains the following conformance improvements, bug fixes, and behavior changes in the Microsoft C++ compiler.
16
16
17
17
### Warning on bitfield width for enumeration type
0 commit comments