fix: Skip auto-updating .NET installs whose architecture doesn't match the current machine#2695
Draft
Copilot wants to merge 3 commits into
Draft
fix: Skip auto-updating .NET installs whose architecture doesn't match the current machine#2695Copilot wants to merge 3 commits into
Copilot wants to merge 3 commits into
Conversation
Co-authored-by: nagilson <23152278+nagilson@users.noreply.github.com>
When the auto-update service runs, it now checks each stored install's architecture against the current process architecture (os.arch()). Installs whose architecture doesn't match the current machine are silently skipped and a SkippingIncompatibleArchitectureInstall event is emitted. This prevents the tool from downloading and then attempting to execute arm64 .NET on an x64 Windows device (and vice-versa), which would fail with "the file is valid but intended for a different computer". Root cause: extension state containing arm64 install records (e.g. from a prior arm64 VS Code session or migrated settings) caused the LocalInstallUpdateService to try to acquire arm64 .NET from an x64 process, resulting in a binary that cannot be run for validation on the x64 machine. Fixes: #2244 Co-authored-by: nagilson <23152278+nagilson@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix .NET Install Tool update issue for x64 device
fix: Skip auto-updating .NET installs whose architecture doesn't match the current machine
May 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On an x64 machine with arm64 install records in extension state (e.g. from a prior arm64 VS Code session or settings migration), the auto-updater would download arm64 .NET and then fail to validate it — producing "the file is valid but intended for a different computer" (shown above).
Root cause
LocalInstallUpdateService.getInstallGroups()grouped all stored install records for update with no architecture guard. If state contained9.0.16~arm64, the updater downloaded arm64 .NET and attempted to execute it for validation on the x64 process.Changes
LocalInstallUpdateService.ts— IngetInstallGroups(), resolvecurrentArchitectureonce viaDotnetCoreAcquisitionWorker.defaultArchitecture()andcontinuepast any install record whose architecture differs. EmitsSkippingIncompatibleArchitectureInstallfor each skipped install.EventStreamEvents.ts— AddedSkippingIncompatibleArchitectureInstallevent class.LocalInstallUpdateService.test.ts— Replaced hardcoded'x64'in allcreateInstallRecordcalls withDotnetCoreAcquisitionWorker.defaultArchitecture()(correctness on arm64 CI runners). Replaced the "separate architecture groups" test with "It skips installs with architectures incompatible with the current machine" which asserts only the compatible-arch group is acquired/uninstalled and the skip event is emitted.