Closed
Description
Type: Debugger
Describe the bug
- OS and Version:win10 1903 x64
- VS Code Version:1.37.1
- C/C++ Extension Version:0.25.0
To Reproduce
- By looking at the documentation https://code.visualstudio.com/docs/cpp/config-msvc, if I want to use the vc environment in my vs. I have to
Start VS Code from the Developer Command Prompt
.
Additional context
- I looked at
Developer Command Prompt
and found that it was actually setting the environment variables for the current workspace. For example, these variables are set by thevcvarsall.bat
batch file. - This was not a particularly troublesome issue. But when you have multiple versions of visual studio installed on your computer, things start to get into trouble. Every time you open a project, you need to run the corresponding version of the command line tool, which is very troublesome. If you don't do this, you won't be able to compile, suggesting that you can't find
MSBuild
(and I don't know if there are any other hidden dangers). - Is there any way to import these configurations into the environment variables of VSCode, so that you don't need to start the command line tool and
cd workspace
runcode .
with vsCode. Or is there any way to run the load environment variable when vsCode starts? - I am using multiple versions of vistual studio now. I hope that VSCode can compile them without having to run the command line tool to load the VC environment beforehand. I feel that this is not elegant enough. If you run vscode directly and then load the VC environment (for example by configuring the .json file), this will be very comfortable.