cppbuild task uses stale cached VS Developer Environment after upgrading to a newer Visual Studio installation
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 52/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- cpp, typescript, vscode
- 領域
- build-system, devtools
調査の方向性
The issue identifies .vscode/tasks.json, vcvarsall.bat, and the “Set VS Developer Environment” command (#4742) as relevant entry points. Trace how cppbuild obtains and caches the developer environment after a Visual Studio replacement, then reproduce the upgrade sequence and verify the generated task uses the new installation without a manual environment reset.
索引モデルが issue の本文から書いたものです。
説明
Environment
- OS and Version: Windows 11 24H2
- VS Code Version: 1.126.0 (User setup)
- C/C++ Extension Version: 1.34.4
- If using SSH remote, specify OS of remote machine: Running locally
Bug Summary and Steps to Reproduce
Bug Summary:
After upgrading Visual Studio Build tools from 2022 to 2026, IntellSense correctly reports the latest path, while the 'cppbuild' task in .vscode/tasks.json still uses the cached environment, resulting C1083 error: include path cannot be found.
Initially, I speculated that it's a issue in Build tools, but I tried repairing and reinstalling, none of them worked. The enviroment variables in Code.exe seems consistent with vcvarsall.bat, and directly building in command line worked as well.
This suggests the problem must be within the VSCode itself. Eventually I tried "Set VS Developer Environment" (#4742, added in 1.29.0), which fixed the issue.
Seems it caches the detected developer environment somewhere, and this cache is not invalidated/refreshed when the underlying VS installation changes.
Steps to reproduce:
- Install VS Build tools 2022
- Building any C++ project using cl.exe inside VSCode
- Remove VS Build tools 2022, then update to 2026
- See error
Expected behavior:
VSCode starting from vcvarsall.bat should build the project successfully.
Configuration and Logs
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"windowsSdkVersion": "10.0.26100.0",
"compilerPath": "cl.exe",
"cStandard": "c17",
"intelliSenseMode": "windows-msvc-x64"
}
],
"version": 4
}
Current database path: %userprofile%\AppData\Local\Microsoft\vscode-cpptools\5a1572067cb7701b835e17d775b99ce1\.BROWSE.VC.DB
Translation Unit Mappings:
[ <PROJECT_DIR>\<file>.cpp - source TU]:
Translation Unit Configurations:
[ <PROJECT_DIR>\<file>.cpp ]
Process ID: 23980
Memory Usage: 194 MB
Compiler Path: C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools\VC\Tools\MSVC\14.51.36231\bin\Hostx64\x64\cl.exe
Language: C++
Include Paths:
include: C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools\VC\Tools\MSVC\14.51.36231\include
include: C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools\VC\Auxiliary\VS\include
include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt
include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\um
include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\shared
include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\winrt
include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\cppwinrt
system include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\um
system include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt
system include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\shared
system include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\winrt
system include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\cppwinrt
include (recursive): <PROJECT_DIR>
Defines:
_DEBUG
UNICODE
_UNICODE
Standard Version: ms_c++20
IntelliSense Mode: windows-msvc-x64
Other Flags:
--using_directory
C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools\VC\Tools\MSVC\14.51.36231\lib\x64
--using_directory
C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools\VC\Tools\MSVC\14.51.36231\lib\x86\store\references
--using_directory
C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.26100.0
--using_directory
C:\Program Files (x86)\Windows Kits\10\References\10.0.26100.0
--using_directory
C:\Windows\Microsoft.NET\Framework64\v4.0.30319
Total Memory Usage: 194 MB
Other Extensions
No response
Additional context
Related issues
- #14352 and #14089 report a similar-sounding "developer environment" failure, but those describe the feature never successfully applying in the first place.
- 主要言語
- TypeScript
- スター
- 6.2k
- フォーク
- 1.7k
- 平均マージ
- 18時間 37分
- マージ済み PR(30日)
- 50
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/vscode-cpptools のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
microsoft/vscode-cpptools#14801 ·
メンテナーはふだん 1 日以内に返信
-
Browse database relocated to `/var/tmp` despite settings; quickly consumes all available space under `/`対応中かも @Colengms が 3 日前に担当しました。 オープンLanguage Service more info needed
microsoft/vscode-cpptools#14795 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
deduction guides do not work through alias templates対応中かも @Colengms が 3 日前に担当しました。 オープンbug Language Service parser
microsoft/vscode-cpptools#14794 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Extension Signature Verification Failed: C/C++ Extension Pack対応中かも @sean-mcmanus が 6 日前に担当しました。 オープンmore info needed
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
microsoft/vscode-cpptools#14787 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
[Bug] cpptools fails to start on Ubuntu ARM64 due to missing execute permissions on shared libraries対応中かも @Colengms が 10 日前に担当しました。 オープンbug fixed Language Service regression
microsoft/vscode-cpptools#14779 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
microsoft/vscode-cpptools の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
microsoft/vscode-livepreview#876 ·
メンテナーはふだん 1 日以内に返信
-
needs-triage
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
JustJarethB/invoicer#54 ·
-
ICP 1.2.0 shows a scheduled task's interval in milliseconds under the label "Interval (In seconds)"オープンNeeds Triage Type/Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
wso2/product-integrator#2585 ·
メンテナーはふだん 1 日以内に返信
-
check:passed streams:add
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
design
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
MTES-MCT/monitor-field#119 ·
メンテナーはふだん 1 日以内に返信