{"record":{"id":"dd0ad917378321df","repo":"dotnet/aspnetcore","slug":"0-is-flagged-with-singledelivery-but-the-sele","errorCode":null,"errorMessage":"'{0}' is flagged with SingleDelivery, but the selected supplier '{1}' is not flagged with IsFixed","messagePattern":"'(.+?)' is flagged with SingleDelivery, but the selected supplier '(.+?)' is not flagged with IsFixed","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Components/Components/src/CascadingParameterState.cs","lineNumber":67,"sourceCode":"        for (var infoIndex = 0; infoIndex < numInfos; infoIndex++)\n        {\n            ref var info = ref infos[infoIndex];\n            var supplier = GetMatchingCascadingValueSupplier(info, componentState.Renderer, componentState.LogicalParentComponentState);\n            if (supplier != null)\n            {\n                // Although not all parameters might be matched, we know the maximum number\n                resultStates ??= new List<CascadingParameterState>(infos.Length - infoIndex);\n                resultStates.Add(new CascadingParameterState(info, supplier, componentState));\n\n                if (info.Attribute.SingleDelivery)\n                {\n                    hasSingleDeliveryParameters = true;\n                    if (!supplier.IsFixed)\n                    {\n                        // We don't have a use case for IsFixed=false with SingleDelivery=true. To avoid complications about\n                        // subscribing/unsubscribing in this case, just disallow it. It shouldn't be possible for this to\n                        // occur unless someone creates their own CascadingParameterAttributeBase subclass.\n                        throw new InvalidOperationException($\"'{info.Attribute.GetType()}' is flagged with SingleDelivery, but the selected supplier '{supplier.GetType()}' is not flagged with {nameof(ICascadingValueSupplier.IsFixed)}\");\n                    }\n                }\n            }\n        }\n\n        return resultStates ?? (IReadOnlyList<CascadingParameterState>)Array.Empty<CascadingParameterState>();\n    }\n\n    internal static ICascadingValueSupplier? GetMatchingCascadingValueSupplier(in CascadingParameterInfo info, Renderer renderer, ComponentState? componentState)\n    {\n        // First scan up through the component hierarchy\n        var candidate = componentState;\n        while (candidate is not null)\n        {\n            if (candidate.Component is ICascadingValueSupplier valueSupplier && valueSupplier.CanSupplyValue(info))\n            {\n                return valueSupplier;\n            }","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/dotnet/aspnetcore/blob/3600ca084e9c8b5f4174fc5e747f4c52d2100806/src/Components/Components/src/CascadingParameterState.cs#L49-L85","documentation":"Thrown by CascadingParameterState when a cascading parameter is marked SingleDelivery (delivered to exactly one recipient) but the matched supplier is not IsFixed. There is no supported scenario for a non-fixed single-delivery supplier, since subscribing/unsubscribing would be ambiguous; the combination is disallowed to surface a misuse early.","triggerScenarios":"A custom CascadingParameterAttributeBase subclass declares SingleDelivery=true and is matched against an ICascadingValueSupplier whose IsFixed is false. The stock CascadingParameterAttribute is multi-delivery; this only arises from a custom attribute/supplier pair.","commonSituations":"Writing a custom cascading parameter attribute (advanced) that sets SingleDelivery and pairing it with a supplier that updates over time (IsFixed=false); copying a supplier implementation that is not marked fixed into a single-delivery scenario.","solutions":["Make the matching supplier IsFixed=true so the value is delivered once and never updates.","Or set SingleDelivery=false on the custom attribute to allow normal multi-delivery subscription semantics.","If you need both single-delivery and updates, redesign: the supported matrix excludes that combination."],"exampleFix":"// before: SingleDelivery with a non-fixed supplier\npublic class MyCascadingValueSupplier : ICascadingValueSupplier\n{\n    public bool IsFixed => false; // triggers the throw\n}\n[MyCascadingParameter(SingleDelivery = true)] public string? Value { get; set; }\n\n// after: fixed supplier matches single-delivery contract\npublic class MyCascadingValueSupplier : ICascadingValueSupplier\n{\n    public bool IsFixed => true;\n}","handlingStrategy":"validation","validationCode":"// When authoring a custom cascading parameter attribute, ensure the paired supplier is IsFixed if SingleDelivery is true.\nif (attribute.SingleDelivery && !supplier.IsFixed) { throw new InvalidOperationException(\"Pair SingleDelivery with IsFixed.\"); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat custom cascading parameter attributes as advanced; review the supplier's IsFixed contract.","Add a unit test that exercises the attribute/supplier combination.","Prefer the built-in CascadingParameterAttribute unless you need single delivery."],"tags":["blazor","aspnetcore","cascading-parameters","components","configuration"],"backgroundTag":null,"analyzedSha":"3600ca084e9c8b5f4174fc5e747f4c52d2100806","analyzedAt":"2026-08-11T16:32:30.678Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}