cppbuild task uses stale cached VS Developer Environment after upgrading to a newer Visual Studio installation
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 52/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- cpp, typescript, vscode
- Bereich
- build-system, devtools
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 6.2k
- Forks
- 1.7k
- Ø Merge
- 18 Std. 16 Min.
- Gemergte PRs (30 T.)
- 51
Entwicklungsumgebung
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus microsoft/vscode-cpptools
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 68/100
microsoft/vscode-cpptools#14801 · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag
-
Browse database relocated to `/var/tmp` despite settings; quickly consumes all available space under `/`Evtl. vergeben @Colengms hat das vor 3 Tagen übernommen. OffenLanguage Service more info needed
microsoft/vscode-cpptools#14795 · 2 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
deduction guides do not work through alias templatesEvtl. vergeben @Colengms hat das vor 3 Tagen übernommen. Offenbug Language Service parser
microsoft/vscode-cpptools#14794 · 2 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
Extension Signature Verification Failed: C/C++ Extension PackEvtl. vergeben @sean-mcmanus hat das vor 6 Tagen übernommen. Offenmore info needed
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
microsoft/vscode-cpptools#14787 · 1 Kommentar · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Bug] cpptools fails to start on Ubuntu ARM64 due to missing execute permissions on shared librariesEvtl. vergeben @Colengms hat das vor 11 Tagen übernommen. Offenbug fixed Language Service regression
microsoft/vscode-cpptools#14779 · 1 Kommentar · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in microsoft/vscode-cpptools
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
openedx/frontend-app-authoring#3274 ·
Maintainer antworten meist innerhalb von 1 Tag
-
🎙️ task - fix(deployer): deploy --env prep runs deploy:dev where the repo declares deploy:prepOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
-
area/documentation status/need-triage
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 95/100
google-gemini/gemini-cli#29548 ·
Maintainer antworten meist innerhalb von 1 Tag
-
sdk-typescript vector-store
Schwierigkeit 2/5 Ein halber Tag Anfängerfreundlichkeit 82/100
mem0ai/mem0#7495 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag