{"record":{"id":"bd2e054d774129f2","repo":"dotnet/aspnetcore","slug":"the-component-nameof-cascadingvalue-tvalue-d","errorCode":null,"errorMessage":"The component '{nameof(CascadingValue<TValue>)}' does not accept a parameter with the name '{parameter.Name}'.","messagePattern":"The component '(.+?)' does not accept a parameter with the name '(.+?)'\\.","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"src/Components/Components/src/CascadingValue.cs","lineNumber":90,"sourceCode":"            else if (parameter.Name.Equals(nameof(ChildContent), StringComparison.OrdinalIgnoreCase))\n            {\n                ChildContent = (RenderFragment)parameter.Value;\n            }\n            else if (parameter.Name.Equals(nameof(Name), StringComparison.OrdinalIgnoreCase))\n            {\n                Name = (string)parameter.Value;\n                if (string.IsNullOrEmpty(Name))\n                {\n                    throw new ArgumentException($\"The parameter '{nameof(Name)}' for component '{nameof(CascadingValue<TValue>)}' does not allow null or empty values.\");\n                }\n            }\n            else if (parameter.Name.Equals(nameof(IsFixed), StringComparison.OrdinalIgnoreCase))\n            {\n                IsFixed = (bool)parameter.Value;\n            }\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.","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/dotnet/aspnetcore/blob/3600ca084e9c8b5f4174fc5e747f4c52d2100806/src/Components/Components/src/CascadingValue.cs#L72-L108","documentation":"CascadingValue<TValue> only accepts three parameters: 'Name' (string), 'IsFixed' (bool), and 'Value' (TValue). Blazor's parameter dispatcher rejects any other attribute name to surface typos and copy-paste mistakes early. This is an ArgumentException thrown during SetParametersAsync.","triggerScenarios":"Writing <CascadingValue SomeUnknown=\"x\"> in Razor, or constructing a ParameterView programmatically with an entry whose Name is not 'Name', 'IsFixed', or 'Value' (case-insensitive match for Name/IsFixed).","commonSituations":"Typo in the Value attribute (e.g. 'Vaule'), copy-pasting attributes from a different component, or referencing a parameter that existed in an older version of the component.","solutions":["Check every attribute on the <CascadingValue> tag against the three valid names: Name, IsFixed, Value.","Remove the offending attribute or rename it to the correct one.","If you need extra behavior, wrap CascadingValue in a custom component rather than adding parameters to it."],"exampleFix":"// before\n<CascadingValue Vaule=\"@myVal\" Name=\"myCtx\">\n// after\n<CascadingValue Value=\"@myVal\" Name=\"myCtx\">","handlingStrategy":"validation","validationCode":"// Validate parameter names against the allowed set before constructing CascadingValue.\nvar allowed = new[] { \"Name\", \"IsFixed\", \"Value\" };\nforeach (var p in parameters)\n{\n    if (!allowed.Any(a => a.Equals(p.Name, StringComparison.OrdinalIgnoreCase)))\n        throw new InvalidOperationException($\"Unknown CascadingValue parameter '{p.Name}'.\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use the IDE's IntelliSense/Blazor language server to catch unknown attributes at design time.","Code-review CascadingValue usages for typos in the three valid parameter names.","Prefer strongly-typed custom wrapper components over ad-hoc CascadingValue markup."],"tags":["blazor","cascading-value","parameters","razor"],"backgroundTag":null,"analyzedSha":"3600ca084e9c8b5f4174fc5e747f4c52d2100806","analyzedAt":"2026-08-11T16:32:30.678Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}