{"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/294cab2f9b2e03af6b953820c7ab497c3c8b7ad9/src/Components/Components/src/CascadingValue.cs#L87-L123","documentation":"Thrown by CascadingValue<TValue>.SetParametersAsync when the Value parameter was never supplied. Even though Value can be null (for reference types), some Value parameter must be explicitly passed — a CascadingValue with no Value serves no purpose. The check uses a hasSuppliedValue flag tracked at CascadingValue.cs:67-70,103-106.","triggerScenarios":"Writing <CascadingValue> without a Value attribute, or <CascadingValue ChildContent>... but omitting Value.","commonSituations":"Copy-paste error where ChildContent is set but Value is dropped; refactoring that removes the Value binding accidentally.","solutions":["Always supply a Value parameter to <CascadingValue>, even if it is null.","If you intended a value-less container, reconsider — CascadingValue requires a value by design."],"exampleFix":"// before\n<CascadingValue>\n    <Consumer />\n</CascadingValue>\n\n// after\n<CascadingValue Value=\"@_someValue\">\n    <Consumer />\n</CascadingValue>","handlingStrategy":"validation","validationCode":"if (!parameters.Any(p => p.Name.Equals(\"Value\", StringComparison.OrdinalIgnoreCase)))\n    throw new ArgumentException(\"CascadingValue requires a Value parameter.\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always include a Value attribute on <CascadingValue>, even if null.","Use IDE/analyzer warnings for missing required parameters."],"tags":["blazor","cascading-value","parameter-binding"],"analyzedSha":"294cab2f9b2e03af6b953820c7ab497c3c8b7ad9","analyzedAt":"2026-08-06T20:08:02.189Z","schemaVersion":2},"datasetVersion":"2026-08-06T23:17:07.152Z"}