Have trouble when Run VS Code outside the Developer Command Prompt
I have set up tasks.json but still can't run VS Code outside the Developer Command Prompt. My tasks.json like this:
{
"windows": {
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/C",
// The path to VsDevCmd.bat depends on the version of Visual Studio you have installed.
"\"C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/Tools/VsDevCmd.bat\"",
"&&"
]
}
}
},
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: cl.exe 生成活动文件",
"command": "cl.exe",
"args": [
"/Zi",
"/EHsc",
"/nologo",
"/Fe${fileDirname}\\${fileBasenameNoExtension}.exe",
"${file}"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$msCompile"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "调试器生成的任务。"
}
],
"version": "2.0.0"
}
when I run code, it still prompt me that I need Developer Command Prompt

follow instructions run-vs-code-outside-the-developer-command-prompt, it's basically a copy and paste, except for modifying the path to the .bat file a bit
Do I need to provide additional information?
@sean-mcmanus, @Colengms is this issue known?
It sounds related to the "cppbuild" task type. It's not picking up the environment set in the other shell setting. It's not a known issue that I've seen.