{"record":{"id":"13668b9e75f00863","repo":"dotnet/aspnetcore","slug":"missing-required-parameter-nameof-value-for-c","errorCode":null,"errorMessage":"Missing required parameter '{nameof(Value)}' for component '{GetType().Name}'.","messagePattern":"Missing required parameter '(.+?)' for component '(.+?)'\\.","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"src/Components/Components/src/CascadingValue.cs","lineNumber":105,"sourceCode":"            }\n            else\n            {\n                throw new ArgumentException($\"The component '{nameof(CascadingValue<TValue>)}' does not accept a parameter with the name '{parameter.Name}'.\");\n            }\n        }\n\n        if (_hasSetParametersPreviously && IsFixed != previousFixed)\n        {\n            throw new InvalidOperationException($\"The value of {nameof(IsFixed)} cannot be changed dynamically.\");\n        }\n\n        _hasSetParametersPreviously = true;\n\n        // It's OK for the value to be null, but some \"Value\" param must be supplied\n        // because it serves no useful purpose to have a <CascadingValue> otherwise.\n        if (!hasSuppliedValue)\n        {\n            throw new ArgumentException($\"Missing required parameter '{nameof(Value)}' for component '{GetType().Name}'.\");\n        }\n\n        // Rendering is most efficient when things are queued from rootmost to leafmost.\n        // Given a components A (parent) -> B (child), you want them to be queued in order\n        // [A, B] because if you had [B, A], then the render for A might change B's params\n        // making it render again, so you'd render [B, A, B], which is wasteful.\n        // At some point we might consider making the render queue actually enforce this\n        // ordering during insertion.\n        //\n        // For the CascadingValue component, this observation is why it's important to render\n        // ourself before notifying subscribers (which can be grandchildren or deeper).\n        // If we rerendered subscribers first, then our own subsequent render might cause an\n        // further update that makes those nested subscribers get rendered twice.\n        _renderHandle.Render(Render);\n\n        if (_subscribers != null && ChangeDetection.MayHaveChanged(previousValue, Value))\n        {\n            NotifySubscribers(parameters.Lifetime);","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/dotnet/aspnetcore/blob/3600ca084e9c8b5f4174fc5e747f4c52d2100806/src/Components/Components/src/CascadingValue.cs#L87-L123","documentation":"CascadingValue requires a Value parameter to be supplied. A null Value is acceptable for reference-type TValue, but the parameter entry itself must be present because a CascadingValue with no value serves no purpose and would silently break consumers.","triggerScenarios":"<CascadingValue Name=\"ctx\"> without a Value attribute, or a ParameterView that omits the 'Value' entry entirely.","commonSituations":"Forgot the Value attribute, conditional rendering that strips Value under some branch, or binding Value to an expression that produces no parameter.","solutions":["Add the Value attribute to the <CascadingValue> element.","If null is intentional for a reference type, explicitly set Value=\"@(null)\".","Add an @if guard so the CascadingValue only renders when a value is available."],"exampleFix":"// before\n<CascadingValue Name=\"myCtx\">\n    <Child />\n</CascadingValue>\n// after\n<CascadingValue Name=\"myCtx\" Value=\"@myValue\">\n    <Child />\n</CascadingValue>","handlingStrategy":"validation","validationCode":"// Guard the markup so CascadingValue only renders when a value exists.\n@if (myValue is not null || typeof(TValue).IsValueType)\n{\n    <CascadingValue Value=\"@myValue\">@ChildContent</CascadingValue>\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always include a Value attribute on CascadingValue.","Use @if guards to skip the component when no value is available.","For nullable reference types, decide explicitly whether null is a valid cascaded value."],"tags":["blazor","cascading-value","parameters","required"],"backgroundTag":null,"analyzedSha":"3600ca084e9c8b5f4174fc5e747f4c52d2100806","analyzedAt":"2026-08-11T16:32:30.678Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}