Fix version resolution order for global SDK installation with single-digit versions #2479
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.
Global SDK installation failed when using single-digit versions (e.g., "7", "8", "9") because
getMajorMinor()was called on unresolved versions before they could be expanded to full semver format.Root Cause
In
dotnet.acquireGlobalSDK, the existing install check ran before version resolution:The check internally called
getMajorMinor("7")which expects at least two parts and threw:"The requested version 7 is invalid"Changes
getExistingInstallOffline()call after version resolution to ensure all version operations work with fully-resolved semverThis preserves the existing install check while ensuring the version format is valid for all downstream operations.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
microsoft.comnode /home/REDACTED/work/vscode-dotnet-runtime/vscode-dotnet-runtime/vscode-dotnet-runtime-library/node_modules/.bin/mocha -u tdd -- dist/test/unit/DebianDistroTests.test.js dist/test/unit/DotnetConditionValidator.test.js dist/test/unit/DotnetCoreAcquisitionWorker.test.js dist/test/unit/DotnetPathFinder.test.js dist/test/unit/DotnetResolver.test.js dist/test/unit/ErrorHandler.test.js dist/test/unit/ExecutableArchitectureDetector.test.js dist/test/unit/ExistingPathResolver.test.js dist/test/unit/GlobalInstallerResolver.test.js dist/test/unit/InstallScriptAcquisitionWorker.test.js dist/test/unit/InstallTracker.test.js dist/test/unit/InstallationValidator.test.js dist/test/unit/IssueReporter.test.js dist/test/unit/JsonInstaller.test.js dist/test/unit/LinuxDistroTests.test.js dist/test/unit/LinuxVersionResolver.test.js dist/test/unit/LocalInstallUpdateService.test.js dist/test/unit/LocalMemoryCacheSingleton.test.js dist/test/unit/LoggingObserver.test.js dist/test/unit/NodeIPCMutex.test.js dist/test/unit/OutputChannelObserver.test.js dist/test/unit/RedHatDistroTests.test.js dist/test/unit/RegistryReader.test.js dist/test/unit/SerializationHelpers.test.js dist/test/unit/VersionResolver.test.js dist/test/unit/VersionUtilities.test.js dist/test/unit/WebRequestWorker.test.js dist/test/unit/WinMacGlobalInstaller.test.js Global Installer Resolver(dns block)node /home/REDACTED/work/vscode-dotnet-runtime/vscode-dotnet-runtime/vscode-dotnet-runtime-library/node_modules/.bin/mocha -u tdd -- dist/test/unit/DebianDistroTests.test.js dist/test/unit/DotnetConditionValidator.test.js dist/test/unit/DotnetCoreAcquisitionWorker.test.js dist/test/unit/DotnetPathFinder.test.js dist/test/unit/DotnetResolver.test.js dist/test/unit/ErrorHandler.test.js dist/test/unit/ExecutableArchitectureDetector.test.js dist/test/unit/ExistingPathResolver.test.js dist/test/unit/GlobalInstallerResolver.test.js dist/test/unit/InstallScriptAcquisitionWorker.test.js dist/test/unit/InstallTracker.test.js dist/test/unit/InstallationValidator.test.js dist/test/unit/IssueReporter.test.js dist/test/unit/JsonInstaller.test.js dist/test/unit/LinuxDistroTests.test.js dist/test/unit/LinuxVersionResolver.test.js dist/test/unit/LocalInstallUpdateService.test.js dist/test/unit/LocalMemoryCacheSingleton.test.js dist/test/unit/LoggingObserver.test.js dist/test/unit/NodeIPCMutex.test.js dist/test/unit/OutputChannelObserver.test.js dist/test/unit/RedHatDistroTests.test.js dist/test/unit/RegistryReader.test.js dist/test/unit/SerializationHelpers.test.js dist/test/unit/VersionResolver.test.js dist/test/unit/VersionUtilities.test.js dist/test/unit/WebRequestWorker.test.js dist/test/unit/WinMacGlobalInstaller.test.js Version Utilities|Global Installer Resolver(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.