Skip to content

dotnetup install sdk preview fails when no preview version is available for latest #52675

@nagilson

Description

@nagilson

Preview channel should fall back to latest GA when no previews are available

Summary

When a user requests the preview channel but no preview releases are currently available, dotnetup should install the latest GA (General Availability) version with a warning, rather than failing or installing an outdated preview from a previous major version.

Background

There is a window each year (typically November through February) where no preview releases exist:

  • The current major version (e.g., .NET 10) has gone GA
  • The next major version's previews (e.g., .NET 11) haven't started yet

During this window, a user running dotnetup sdk install --channel preview will get no result.

Related test (currently skipped for this reason):
https://github.com/dotnet/sdk/blob/nagilson-dnup-install-runtimes-impl/test/dotnetup.Tests/ChannelVersionResolverTests.cs#L78-L99

Current Behavior

When no preview releases are available, the preview channel resolution returns null, which would cause the installation to fail.

Proposed Behavior

When the preview channel is requested but no preview releases exist:

  1. Fall back to the latest GA version - Install the newest stable release
  2. Emit a warning explaining what happened:
    Warning: No preview releases are currently available. Installing the latest GA version (10.0.102) instead.
    Preview releases for .NET 11 will be available starting around February 2026.
    

Why this is better than installing an older preview

An alternative approach would be to find the most recent preview release from any version (e.g., .NET 10 Preview 7 from October 2025). This is not recommended because:

  1. Older previews are superseded by GA - .NET 10 Preview 7 is strictly worse than .NET 10 GA in every way
  2. Preview users want the bleeding edge - They're seeking the newest features, not outdated pre-release software
  3. Security and stability - GA releases have all the fixes that previews were missing
  4. Semantic expectation - "preview" implies "ahead of stable," not "behind stable"

Design Questions

  1. Should the fallback be opt-in?

    • Option A: Always fall back with a warning (recommended)
    • Option B: Require --allow-fallback flag
    • Option C: Prompt interactively in interactive mode
  2. Should we predict when previews will be available?

    • We could provide an approximate date based on the typical .NET release cadence
    • Risk: Dates may change, leading to incorrect information
  3. Should --channel preview with --no-fallback fail explicitly?

    • This would let CI/CD pipelines detect when previews aren't available

Acceptance Criteria

  • dotnetup sdk install --channel preview installs latest GA when no previews exist
  • A clear warning is emitted explaining the fallback
  • The skipped test can be updated to verify this behavior year-round
  • Documentation updated to explain this behavior

Related

Metadata

Metadata

Labels

BugCost:SLess than 4 person weeks of work per central guidancedotnetupWork items around the proposed `dotnetup` bootstrapper/toolchain management tool and libraryuntriagedRequest triage from a team member

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions