Summary
The Aspire CLI should know its distribution channel — stable, daily, or pr — via build-time metadata embedded in the binary, rather than reading a mutable "channel" setting from aspire.config.json.
Proposed channels
| Channel |
Built from |
| stable |
Release branches, official builds |
| daily |
main, official daily builds |
| pr |
PR CI builds, localhive |
Mechanism
-
New MSBuild property — <CliChannel>stable</CliChannel> — set per build configuration:
- Official release builds:
stable
- Official daily builds:
daily
localhive / PR scripts: pr
-
Bake into binary — surface as [assembly: AssemblyMetadata("CliChannel", "stable")] so it can be read at runtime without sidecar files.
-
Runtime behavior — PackagingService.GetChannelsAsync() uses the embedded channel as its default instead of falling back to an implicit "whatever NuGet feeds are configured" channel. The embedded channel determines:
- Which NuGet feeds to search for packages
- Which CLI download base URL to use for
aspire update --self
- Whether self-update is available at all (PR builds: no)
- Which package quality to search for (stable → stable only, daily → prerelease)
-
Remove "channel" from aspire.config.json — the --channel CLI argument on aspire update can remain as an override for power users, but the default comes from the embedded metadata.
Key files
| File |
Change |
src/Aspire.Cli/Aspire.Cli.csproj |
Add CliChannel property, emit assembly metadata |
src/Aspire.Cli/Packaging/PackagingService.cs |
Read embedded channel, use as default for GetChannelsAsync() |
src/Aspire.Cli/Commands/UpdateCommand.cs |
Use embedded channel as default for --self update |
src/Aspire.Cli/Configuration/AspireConfigFile.cs |
Remove Channel property |
eng/Bundle.proj |
Set CliChannel based on build type |
localhive.sh / localhive.ps1 |
Set CliChannel=pr when building |
eng/clipack/Common.projitems |
Set CliChannel for archive builds |
Related
Summary
The Aspire CLI should know its distribution channel —
stable,daily, orpr— via build-time metadata embedded in the binary, rather than reading a mutable"channel"setting fromaspire.config.json.Proposed channels
main, official daily buildslocalhiveMechanism
New MSBuild property —
<CliChannel>stable</CliChannel>— set per build configuration:stabledailylocalhive/ PR scripts:prBake into binary — surface as
[assembly: AssemblyMetadata("CliChannel", "stable")]so it can be read at runtime without sidecar files.Runtime behavior —
PackagingService.GetChannelsAsync()uses the embedded channel as its default instead of falling back to an implicit "whatever NuGet feeds are configured" channel. The embedded channel determines:aspire update --selfRemove
"channel"fromaspire.config.json— the--channelCLI argument onaspire updatecan remain as an override for power users, but the default comes from the embedded metadata.Key files
src/Aspire.Cli/Aspire.Cli.csprojCliChannelproperty, emit assembly metadatasrc/Aspire.Cli/Packaging/PackagingService.csGetChannelsAsync()src/Aspire.Cli/Commands/UpdateCommand.cs--selfupdatesrc/Aspire.Cli/Configuration/AspireConfigFile.csChannelpropertyeng/Bundle.projCliChannelbased on build typelocalhive.sh/localhive.ps1CliChannel=prwhen buildingeng/clipack/Common.projitemsCliChannelfor archive buildsRelated