Skip to content

Support preview .NET versions in vscode acquisition - #2760

Open
nagilson wants to merge 24 commits into
dotnet:mainfrom
nagilson:nagilson-fix-preview-version-parsing
Open

Support preview .NET versions in vscode acquisition #2760
nagilson wants to merge 24 commits into
dotnet:mainfrom
nagilson:nagilson-fix-preview-version-parsing

Conversation

@nagilson

@nagilson nagilson commented Jul 21, 2026

Copy link
Copy Markdown
Member

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.

@nagilson
nagilson requested a review from Copilot July 21, 2026 22:04
@nagilson nagilson changed the title Nagilson fix preview version parsing Support preview .NET versions in vscode acquisition Jul 21, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/-rc are 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.

Comment thread vscode-dotnet-runtime-library/src/Utils/InstallIdUtilities.ts Outdated
Comment thread vscode-dotnet-runtime-library/src/Acquisition/VersionUtilities.ts
@nagilson
nagilson marked this pull request as ready for review July 22, 2026 21:52
Copilot AI review requested due to automatic review settings July 22, 2026 21:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 32 out of 32 changed files in this pull request and generated 2 comments.

Comment thread vscode-dotnet-runtime-library/src/Utils/InstallIdUtilities.ts
Comment thread vscode-dotnet-runtime-library/src/Acquisition/DistroTypes.ts Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 22, 2026 22:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  • isFullySpecifiedPreviewVersion returns true for both preview and rc suffixes (and the docs/tests reflect that). The name is misleading and can cause incorrect assumptions by callers; consider renaming it to something like isFullySpecifiedPreReleaseVersion/isFullySpecifiedPrereleaseVersion and updating call sites.
export function isFullySpecifiedPreviewVersion(version: string, eventStream: IEventStream, context: IAcquisitionWorkerContext): boolean
{
    return isHistoricalDotnetPreReleaseSuffix(getPreReleaseSuffix(version)) &&
        isFullySpecifiedVersion(getVersionWithoutPreReleaseSuffix(version), eventStream, context);
}

Comment thread vscode-dotnet-runtime-library/src/Acquisition/DistroTypes.ts Outdated
Copilot AI review requested due to automatic review settings July 22, 2026 22:30
@nagilson
nagilson requested review from a team and mthalman July 22, 2026 22:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 \r characters 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.
*--------------------------------------------------------------------------------------------*/

Comment thread vscode-dotnet-runtime-library/src/Acquisition/VersionUtilities.ts
Copilot AI review requested due to automatic review settings July 22, 2026 22:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 34 out of 34 changed files in this pull request and generated no new comments.

Comment on lines -226 to +233
export function isPreviewVersion(fullySpecifiedVersion: string, eventStream: IEventStream, context: IAcquisitionWorkerContext): boolean
export function hasPreReleaseSuffix(version: string): boolean

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change since VersionUtilities is exported for this library:

export * from './Acquisition/VersionUtilities';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Preview versions are unsupported, which causes issues for pinned global.json

3 participants