Skip to content

Commit 4b321eb

Browse files
committed
Improve dev command line instructions
1 parent 8c87d86 commit 4b321eb

5 files changed

+11
-4
lines changed

docs/build/building-on-the-command-line.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ The Start menu folder and shortcut names vary depending on the installed version
7979

8080
For an even faster way to open a developer command prompt, enter *developer command prompt* in the desktop search box. Then choose the result you want.
8181

82+
> [!NOTE]
83+
> By default, the current working directory in a developer command prompt is the root of your Visual Studio installation in the Program Files directory. This isn't an appropriate location for your code and projects. Change the current working directory to another location before you create a project. The IDE creates projects in your user directory, typically in *%USERPROFILE%\\source\\repos*.
84+
8285
## <a name="developer_command_file_locations"></a> Developer command file locations
8386

8487
If you prefer to set the build environment in an existing command prompt window, you can use one of the command files created by the installer. We recommend you set the environment in a new command prompt window. We don't recommend you later switch environments in the same command window.

docs/build/cmakesettings-reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ If you don't define the `"type"`, the `"STRING"` type is assumed by default.
145145

146146
## <a name="environments"></a> Environments
147147

148-
An *environment* encapsulates the environment variables set in the process that Visual Studio uses to invoke CMake. For MSVC projects, it captures the variables set in a [developer command prompt](building-on-the-command-line.md) for a specific platform. For example, the `msvc_x64_x64` environment is the same as running the **Developer Command Prompt for VS 2017** or **Developer Command Prompt for VS 2019** with the **-arch=amd64 -host_arch=amd64** arguments. You can use the `env.{<variable_name>}` syntax in *`CMakeSettings.json`* to reference the individual environment variables, for example to construct paths to folders. The following predefined environments are provided:
148+
An *environment* encapsulates the environment variables set in the process that Visual Studio uses to invoke CMake. For MSVC projects, it captures the variables set in a [developer command prompt](building-on-the-command-line.md) for a specific platform. For example, the `msvc_x64_x64` environment is the same as running the **Developer Command Prompt for VS {version}** with the **-arch=amd64 -host_arch=amd64** arguments. You can use the `env.{<variable_name>}` syntax in *`CMakeSettings.json`* to reference the individual environment variables, for example to construct paths to folders. The following predefined environments are provided:
149149

150150
- `linux_arm`: Target ARM Linux remotely.
151151
- `linux_x64`: Target x64 Linux remotely.

docs/build/reference/netmodule-files-as-linker-input.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ link.exe accepts MSIL *`.obj`* and *`.netmodule`* files as input. The output fil
1616

1717
The linker must be passed the *`.obj`* file from the C++ compilation that created the *`.netmodule`*. Passing in a *`.netmodule`* is no longer supported because the **/clr:pure** and **/clr:safe** compiler options are deprecated in Visual Studio 2015 and unsupported in Visual Studio 2017 and later.
1818

19-
For information on how to invoke the linker from the command line, see [Linker command-line syntax](linking.md), [Use the MSVC toolset from the command line](../building-on-the-command-line.md), and [Use the MSVC toolset from the command line](../building-on-the-command-line.md).
19+
For information on how to invoke the linker from the command line, see [Linker command-line syntax](linking.md) and [Use the MSVC toolset from the command line](../building-on-the-command-line.md).
2020

2121
Passing a *`.netmodule`* or *`.dll`* file to the linker that was compiled by the MSVC compiler with **/clr** can result in a linker error. For more information, see [Choosing the format of .netmodule input files](choosing-the-format-of-netmodule-input-files.md).
2222

docs/build/walkthrough-compiling-a-cpp-cli-program-on-the-command-line.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ To enable compilation for C++/CLI, you must use the [/clr](reference/clr-common-
2626

2727
Administrator credentials may be required to successfully compile the code, depending on the computer's operating system and configuration. To run the command prompt window as an administrator, right-click to open the shortcut menu for the command prompt and then choose **More** > **Run as administrator**.
2828

29+
1. Change the current working directory in the command prompt window to a directory you can write to, such as your Documents directory.
30+
2931
1. At the command prompt, enter `notepad basicclr.cpp`.
3032

3133
Choose **Yes** when you're prompted to create a file.

docs/build/walkthrough-compiling-a-cpp-cx-program-on-the-command-line.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@ To enable compilation for C++/CX, you must use the [/ZW](reference/zw-windows-ru
2626

2727
#### To compile a C++/CX application on the command line
2828

29-
1. Open a **Developer Command Prompt** window. (On the **Start** window, open **Apps**. Open the **Visual Studio Tools** folder under your version of Visual Studio, and then choose the **Developer Command Prompt** shortcut.) For more information about how to open a Developer Command Prompt window, see [Use the MSVC toolset from the command line](building-on-the-command-line.md).
29+
1. Open a **Developer Command Prompt** window. For specific instructions, see [To open a developer command prompt window](building-on-the-command-line.md#developer_command_prompt).
3030

31-
Administrator credentials may be required to successfully compile the code, depending on the computer's operating system and configuration. To run the Command Prompt window as an administrator, open the shortcut menu for **Developer Command Prompt** and then choose **Run as administrator**.
31+
Administrator credentials may be required to successfully compile the code, depending on the computer's operating system and configuration. To run the command prompt window as an administrator, right-click to open the shortcut menu for the command prompt and then choose **More** > **Run as administrator**.
32+
33+
1. Change the current working directory in the command prompt window to a directory you can write to, such as your Documents directory.
3234

3335
1. At the command prompt, enter **notepad basiccx.cpp**.
3436

0 commit comments

Comments
 (0)