Support preview .NET versions in vscode acquisition - #2760
Conversation
…may appear in preview versions
…ions as sdk versions
…ce they're in built-in feeds
preview .NET versions in vscode acquisition
There was a problem hiding this comment.
Pull request overview
This PR updates the runtime acquisition library + extension to correctly recognize and compare fully specified pre-release .NET versions (e.g. -preview.*, -rc.*), addressing pinned global.json scenarios that previously failed version parsing and install matching (issue #2759).
Changes:
- Add pre-release-aware version parsing/comparison helpers (via
semver) and use them in conflict/upgrade detection and “latest installed” selection. - Fix legacy global install-id version extraction so versions containing
-preview/-rcare not truncated. - Expand tests and distro package support data to cover pre-release/11.0 scenarios.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| vscode-dotnet-runtime-library/src/Utils/InstallIdUtilities.ts | Preserve full pre-release version when extracting version from legacy global install IDs. |
| vscode-dotnet-runtime-library/src/Acquisition/VersionUtilities.ts | Add pre-release helpers (getPreReleaseSuffix, comparisons including pre-release, etc.). |
| vscode-dotnet-runtime-library/src/Acquisition/VersionResolver.ts | Accept -preview/-rc suffixes when validating version input formatting. |
| vscode-dotnet-runtime-library/src/Acquisition/WinMacGlobalInstaller.ts | Use pre-release-aware comparison to treat newer previews as upgrades (not conflicts). |
| vscode-dotnet-runtime-library/src/Acquisition/LinuxVersionResolver.ts | Detect SDK patch/pre-release upgrades correctly on Linux global installs. |
| vscode-dotnet-runtime-library/src/Acquisition/LocalInstallUpdateService.ts | Select newest install using pre-release-aware version comparison. |
| vscode-dotnet-runtime-library/src/Acquisition/GenericDistroSDKProvider.ts | Treat fully specified pre-release SDKs from dotnet --version as valid installed versions. |
| vscode-dotnet-runtime-library/src/Acquisition/DotnetInstall.ts | Correctly classify pre-release runtime versions vs SDK versions. |
| vscode-dotnet-runtime-library/src/Acquisition/DotnetConditionValidator.ts | Fix x.y.0 handling and enforce exact pre-release identity when rollForward is disable. |
| vscode-dotnet-runtime-library/src/Acquisition/GlobalInstallerResolver.ts | Update SDK resolution comments/error text now that pre-releases are supported. |
| vscode-dotnet-runtime-library/distro-data/distro-support.json | Add .NET 11.0 package IDs to supported SDK/runtime/aspnetcore lists for multiple distros. |
| vscode-dotnet-runtime-library/src/test/unit/WinMacGlobalInstaller.test.ts | Add regression test for preview upgrade vs conflict behavior on Windows. |
| vscode-dotnet-runtime-library/src/test/unit/VersionUtilities.test.ts | Add tests for pre-release detection, suffix parsing, and ordering semantics. |
| vscode-dotnet-runtime-library/src/test/unit/InstallIdUtilities.test.ts | New tests ensuring global legacy install-id parsing preserves pre-release versions. |
| vscode-dotnet-runtime-library/src/test/unit/DotnetConditionValidator.test.ts | Add tests ensuring rollForward disable distinguishes pre-release identities and x.y.0. |
| vscode-dotnet-runtime-extension/src/LanguageModelTools.ts | Use pre-release-aware ordering when selecting highest patch within a feature band. |
| vscode-dotnet-runtime-extension/src/test/functional/LanguageModelTools.test.ts | Add functional tests for ordering stable > preview and preview.6 > preview.5. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 32 out of 32 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
vscode-dotnet-runtime-library/src/Acquisition/VersionUtilities.ts:290
isFullySpecifiedPreviewVersionreturns true for bothpreviewandrcsuffixes (and the docs/tests reflect that). The name is misleading and can cause incorrect assumptions by callers; consider renaming it to something likeisFullySpecifiedPreReleaseVersion/isFullySpecifiedPrereleaseVersionand updating call sites.
export function isFullySpecifiedPreviewVersion(version: string, eventStream: IEventStream, context: IAcquisitionWorkerContext): boolean
{
return isHistoricalDotnetPreReleaseSuffix(getPreReleaseSuffix(version)) &&
isFullySpecifiedVersion(getVersionWithoutPreReleaseSuffix(version), eventStream, context);
}
…legacy install id
….com/nagilson/vscode-dotnet-runtime into nagilson-fix-preview-version-parsing
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 34 out of 34 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
vscode-dotnet-runtime-library/src/Acquisition/DistroTypes.ts:4
- This new file appears to contain CRLF line endings / stray
\rcharacters in the header (visible in the repo view output). Please normalize the file to LF so it matches the rest of the repository and avoids noisy diffs / potential lint issues.
/*---------------------------------------------------------------------------------------------
* Licensed to the .NET Foundation under one or more agreements.
* The .NET Foundation licenses this file to you under the MIT license.
*--------------------------------------------------------------------------------------------*/
| export function isPreviewVersion(fullySpecifiedVersion: string, eventStream: IEventStream, context: IAcquisitionWorkerContext): boolean | ||
| export function hasPreReleaseSuffix(version: string): boolean |
There was a problem hiding this comment.
This is a breaking change since VersionUtilities is exported for this library:
Resolves #2759
I also built the VSIX to confirm manually that it works now, and will have vendors also try our testing plan with preview versions.