-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
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:
- Fall back to the latest GA version - Install the newest stable release
- 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:
- Older previews are superseded by GA - .NET 10 Preview 7 is strictly worse than .NET 10 GA in every way
- Preview users want the bleeding edge - They're seeking the newest features, not outdated pre-release software
- Security and stability - GA releases have all the fixes that previews were missing
- Semantic expectation - "preview" implies "ahead of stable," not "behind stable"
Design Questions
-
Should the fallback be opt-in?
- Option A: Always fall back with a warning (recommended)
- Option B: Require
--allow-fallbackflag - Option C: Prompt interactively in interactive mode
-
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
-
Should
--channel previewwith--no-fallbackfail explicitly?- This would let CI/CD pipelines detect when previews aren't available
Acceptance Criteria
-
dotnetup sdk install --channel previewinstalls 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