Answer to the Core Questions
1. Distinguishing a binary failure from User Data corruption.
- During an update, VS Code downloads a compressed binary package and verifies its SHA‑256 checksum against the value shipped in the update manifest.
- If the checksum fails, the installer marks the binary as corrupted and restores the previous executable from the
previous backup folder. This rollback is independent of the User folder, which is never touched by the binary replacement step.
- Corruption inside the shared
User directory is not detected by the binary update process. VS Code only checks the integrity of the downloaded package; any issues in User (e.g., a malformed settings file) will surface only when the editor starts and loads those files.
2. Extensions that have migrated schemas when the binary reverts.
- Extensions write their own schema migrations to the
User/Extensions/ext-id/storage.json file. Once a migration has run, the file contains a newer schema version.
- If the application binary reverts to an older VS Code release that does not understand the new schema, the extension host will either:
- fall back to the last known compatible schema, or
- log an error and disable the extension until the binary is updated again.
- In practice, most extensions include a compatibility check against
vscode.version. If the check fails, the extension will refuse to load rather than corrupting the user data.
Likely Explanation (Based on Current Knowledge)
VS Code’s update engine writes a small update-config.json file in the installation directory. The file contains a flag binaryRecovery: true/false. When true, the installer follows the Binary Recovery path: it downloads, verifies, and replaces the executable, then restores the previous binary if verification fails. When false, it follows the User Data Integrity path, which first validates the new binary before committing it, and only then touches the User folder.
Because the User folder is not part of the checksum verification, a corrupt User file will not trigger a binary rollback. Instead, the error will appear at launch, often as a “Failed to load settings” or “Extension host error” message.
Steps to Verify and Troubleshoot the Current Mode
- Locate the update configuration.
cd "C:\\Users\\<user>\\AppData\\Local\\Programs\\Microsoft VS Code"
notepad update-config.json
- Check the active mode in the logs.
code --verbose
# In the Output panel → Log (Extension Host), look for:
# Update mode: Binary Recovery
# or
# Update mode: User Data Integrity
- Inspect the update log file.
type update-log.txt
# The first line contains the mode used during the last update attempt.
- Verify the binary version.
code --version
# A change in the number indicates the executable was replaced.
- Confirm that the User folder is untouched.
dir /T:W "C:\\Users\\<user>\\AppData\\Roaming\\Code\\User"
# Compare timestamps before and after the update.
Switching Modes (Advanced)
To force Binary Recovery, delete the update-config.json file and restart VS Code; the installer will regenerate the file with binaryRecovery: true. To force User Data Integrity, edit the file to set binaryRecovery: false, or run code --force-update from a command prompt.
Missing Diagnostic Detail Needed for Precise Guidance
Could you provide the operating system (Windows/macOS/Linux) and the current VS Code version you are running? These details may influence the recommended update path and the exact location of the configuration files.