次の方法で共有


/UseEnv (devenv.exe)

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

Starts Visual Studio and loads certain environment variables for compilation.

Note

This switch is installed with the Desktop development with C++ workload.

Syntax

devenv /UseEnv {SolutionName|ProjectName}

Arguments

  • SolutionName

    The full path and name of a solution file.

  • ProjectName

    The full path and name of a project file.

Remarks

This switch affects the Visual Studio IDE in the project properties for VC++ Directories. If you specify the /UseEnv switch, the VC++ Directories node shows the values for the PATH, INCLUDE, LIBPATH, and LIB environment variables. (It also shows values for Source Directories and Exclude Directories.) Otherwise, the node replaces the environment variables with five directory values: Executable Directories, Include Directories, Reference Directories, Library Directories, and Library WinRT Directories.

Tip

You access the project properties by right-clicking a C++ project and selecting Properties. In the Property Pages dialog box, select Configuration Properties and then VC++ Directories.

When a project name is specified with this switch, the tool displays the environment variables for all projects within the project's parent solution.

Example

The following example starts Visual Studio and loads environment variables into the property pages of the MySolution solution.

devenv.exe /useenv "%USERPROFILE%\source\repos\MySolution\MySolution.sln"

See also