microsoft/aspire · error · ChannelNotFoundException
No channel found matching
Error message
No channel found matching '{0}'. Valid options are: {1}. What it means
Thrown by the Aspire CLI `aspire update` command when the channel name supplied via `--channel`, project config, or global config does not match any channel registered with the packaging service. The message lists the valid channel names so the user can correct the value. For the special 'staging' channel, a more specific packaging-service reason is thrown instead when available.
Solutions
- Run `aspire update` without --channel and pick from the prompted list of valid channels
- Use one of the valid channel names listed in the error message (e.g. --channel stable or --channel daily)
- Fix or remove the `channel` key in aspire.config.json (project) or the global config if it contains an invalid value
- If you intended the staging channel, ensure the CLI build supports it or set the required staging channel override
Example fix
// before aspire update --channel preview // after aspire update --channel stable
Defensive patterns
Strategy: validation
Validate before calling
var valid = new[] { "stable", "daily", "staging" };
if (!valid.Contains(channelName, StringComparer.OrdinalIgnoreCase))
throw new ArgumentException($"Unknown channel '{channelName}'. Valid: {string.Join(", ", valid)}"); Try / catch
try { await UpdateCommand.RunAsync(--channel value); }
catch (ChannelNotFoundException ex) { Console.Error.WriteLine(ex.Message); return 1; } Prevention
- Always pass a channel name from the list printed in the error message
- Keep channel config values in sync with supported channels after CLI upgrades
- In CI, pin the channel to 'stable' unless explicitly testing daily builds
When it happens
Trigger: Running `aspire update --channel <name>` where <name> is not one of stable/daily/staging (or available channels); or having a misspelled or obsolete `channel` value in aspire.config.json or global config that the command reads at src/Aspire.Cli/Commands/UpdateCommand.cs:242.
Common situations: Typos like '--channel Stable' vs 'stable' aside (matching is case-insensitive), stale config files referencing removed channels, CI scripts passing a channel name from an old template, or requesting 'staging' on a daily/local/pr-N CLI without the override that synthesizes it.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- Channel ' ' does not support CLI downloads.
- The configuration file
- The configuration file
- The configuration file
- The configuration file
AI-assisted analysis of microsoft/aspire@25830f84bd (2026-09-16).
Data as JSON: /api/errors/aaae7635422c8bad.
Report an issue: GitHub.
Appendix: source
Thrown at src/Aspire.Cli/Commands/UpdateCommand.cs:272
// Try to find a channel matching the provided channel/quality
var matchedChannel = allChannels.FirstOrDefault(c => string.Equals(c.Name, channelName, StringComparisons.ChannelName));
if (matchedChannel is null)
{
// When the user explicitly asked for the 'staging' channel and the packaging
// service refused to synthesize it (daily/local/pr-N CLI without an override),
// surface the packaging-service reason instead of the generic "no channel
// matching" message — the generic message hides the actual fix from the user.
// See https://github.com/microsoft/aspire/issues/16652.
if (string.Equals(channelName, PackageChannelNames.Staging, StringComparisons.ChannelName))
{
var stagingUnavailableReason = _packagingService.GetStagingChannelUnavailableReason();
if (stagingUnavailableReason is not null)
{
throw new ChannelNotFoundException(stagingUnavailableReason);
}
}
throw new ChannelNotFoundException(string.Format(
CultureInfo.CurrentCulture,
UpdateCommandStrings.NoChannelFoundMatching,
channelName,
string.Join(", ", allChannels.Select(c => c.Name))));
}
channel = matchedChannel;
if (channelFromConfig)
{
_logger.LogDebug("Using channel '{ChannelName}' from configuration.", channel.Name);
}
}
else if (isProjectReferenceMode)
{
channel = allChannels.FirstOrDefault(c => c.Type is PackageChannelType.Implicit)
?? allChannels.First();
}View on GitHub (pinned to 25830f84bd)