{"record":{"id":"aaae7635422c8bad","repo":"microsoft/aspire","slug":"no-channel-found-matching-0-valid-options-are-1","errorCode":null,"errorMessage":"No channel found matching '{0}'. Valid options are: {1}.","messagePattern":"No channel found matching '(.+?)'\\. Valid options are: (.+?)\\.","errorType":"exception","errorClass":"ChannelNotFoundException","httpStatus":null,"severity":"error","filePath":"src/Aspire.Cli/Commands/UpdateCommand.cs","lineNumber":272,"sourceCode":"                // Try to find a channel matching the provided channel/quality\n                var matchedChannel = allChannels.FirstOrDefault(c => string.Equals(c.Name, channelName, StringComparisons.ChannelName));\n                if (matchedChannel is null)\n                {\n                    // When the user explicitly asked for the 'staging' channel and the packaging\n                    // service refused to synthesize it (daily/local/pr-N CLI without an override),\n                    // surface the packaging-service reason instead of the generic \"no channel\n                    // matching\" message — the generic message hides the actual fix from the user.\n                    // See https://github.com/microsoft/aspire/issues/16652.\n                    if (string.Equals(channelName, PackageChannelNames.Staging, StringComparisons.ChannelName))\n                    {\n                        var stagingUnavailableReason = _packagingService.GetStagingChannelUnavailableReason();\n                        if (stagingUnavailableReason is not null)\n                        {\n                            throw new ChannelNotFoundException(stagingUnavailableReason);\n                        }\n                    }\n\n                    throw new ChannelNotFoundException(string.Format(\n                        CultureInfo.CurrentCulture,\n                        UpdateCommandStrings.NoChannelFoundMatching,\n                        channelName,\n                        string.Join(\", \", allChannels.Select(c => c.Name))));\n                }\n\n                channel = matchedChannel;\n\n                if (channelFromConfig)\n                {\n                    _logger.LogDebug(\"Using channel '{ChannelName}' from configuration.\", channel.Name);\n                }\n            }\n            else if (isProjectReferenceMode)\n            {\n                channel = allChannels.FirstOrDefault(c => c.Type is PackageChannelType.Implicit)\n                    ?? allChannels.First();\n            }","sourceCodeStart":254,"sourceCodeEnd":290,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Aspire.Cli/Commands/UpdateCommand.cs#L254-L290","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\naspire update --channel preview\n// after\naspire update --channel stable","handlingStrategy":"validation","validationCode":"var valid = new[] { \"stable\", \"daily\", \"staging\" };\nif (!valid.Contains(channelName, StringComparer.OrdinalIgnoreCase))\n    throw new ArgumentException($\"Unknown channel '{channelName}'. Valid: {string.Join(\", \", valid)}\");","typeGuard":null,"tryCatchPattern":"try { await UpdateCommand.RunAsync(--channel value); }\ncatch (ChannelNotFoundException ex) { Console.Error.WriteLine(ex.Message); return 1; }","preventionTips":["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"],"tags":["cli","channel","config"],"backgroundTag":"invalid-enum-value","analyzedSha":"25830f84bd145686607ad00c057b3f84e2e51d43","analyzedAt":"2026-09-16T11:10:06.193Z","contentChangedAt":"2026-09-16T11:10:06.193Z","schemaVersion":2},"datasetVersion":"2026-09-21T09:17:21.228Z"}