{"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/294cab2f9b2e03af6b953820c7ab497c3c8b7ad9/src/Components/Components/src/CascadingParameterState.cs#L49-L85","documentation":"Thrown by CascadingParameterState.FindCascadingParameters when a cascading parameter attribute has SingleDelivery=true (meaning it should only be delivered once and never updated) but the matched value supplier reports IsFixed=false. The framework has no use case for this combination because subscription/unsubscription bookkeeping for non-fixed suppliers on single-delivery parameters would be problematic. This only occurs when a developer creates a custom subclass of CascadingParameterAttributeBase with SingleDelivery=true.","triggerScenarios":"Creating a custom CascadingParameterAttributeBase subclass that sets SingleDelivery=true, then supplying it via a non-fixed ICascadingValueSupplier (e.g., a CascadingValue<T> with IsFixed=false, or a non-fixed CascadingValueSource<T>). The check is at CascadingParameterState.cs:59-68.","commonSituations":"Building a custom cascading parameter attribute for specialized DI-supplied values; library authors extending the cascading parameter system without making their supplier report IsFixed=true.","solutions":["Make your custom ICascadingValueSupplier report IsFixed=true when paired with a SingleDelivery attribute.","Use CascadingValueSource<T> constructed with isFixed:true.","Do not set SingleDelivery=true on your custom attribute if the supplier is dynamic (non-fixed)."],"exampleFix":"// before\npublic class MyCascadingParameterAttribute : CascadingParameterAttributeBase\n{\n    public MyCascadingParameterAttribute() { SingleDelivery = true; }\n}\n// supplier reports IsFixed = false -> throws\n\n// after — make the supplier fixed\npublic class MySupplier : ICascadingValueSupplier\n{\n    public bool IsFixed => true; // required for SingleDelivery attributes\n}","handlingStrategy":"validation","validationCode":"// For custom SingleDelivery attributes, verify supplier.IsFixed\nif (attribute.SingleDelivery && supplier != null && !supplier.IsFixed)\n    throw new InvalidOperationException(\"SingleDelivery requires a fixed supplier.\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When authoring custom CascadingParameterAttributeBase subclasses, pair SingleDelivery=true only with fixed suppliers.","Document the IsFixed requirement on custom attributes."],"tags":["blazor","cascading-parameter","framework-internal","custom-attribute"],"analyzedSha":"294cab2f9b2e03af6b953820c7ab497c3c8b7ad9","analyzedAt":"2026-08-06T20:08:02.189Z","schemaVersion":2},"datasetVersion":"2026-08-06T23:17:07.152Z"}