dotnet/aspnetcore · error · ArgumentException
The component '{nameof(CascadingValue<TValue>)}' does not ac
Error message
The component '{nameof(CascadingValue<TValue>)}' does not accept a parameter with the name '{parameter.Name}'. What it means
Thrown by CascadingValue<TValue>.SetParametersAsync when it receives a parameter whose name is not one of Value, ChildContent, Name, or IsFixed. CascadingValue only accepts these four parameters; any other attribute in markup is rejected as an ArgumentException rather than silently ignored.
Source
Thrown at src/Components/Components/src/CascadingValue.cs:90
else if (parameter.Name.Equals(nameof(ChildContent), StringComparison.OrdinalIgnoreCase))
{
ChildContent = (RenderFragment)parameter.Value;
}
else if (parameter.Name.Equals(nameof(Name), StringComparison.OrdinalIgnoreCase))
{
Name = (string)parameter.Value;
if (string.IsNullOrEmpty(Name))
{
throw new ArgumentException($"The parameter '{nameof(Name)}' for component '{nameof(CascadingValue<TValue>)}' does not allow null or empty values.");
}
}
else if (parameter.Name.Equals(nameof(IsFixed), StringComparison.OrdinalIgnoreCase))
{
IsFixed = (bool)parameter.Value;
}
else
{
throw new ArgumentException($"The component '{nameof(CascadingValue<TValue>)}' does not accept a parameter with the name '{parameter.Name}'.");
}
}
if (_hasSetParametersPreviously && IsFixed != previousFixed)
{
throw new InvalidOperationException($"The value of {nameof(IsFixed)} cannot be changed dynamically.");
}
_hasSetParametersPreviously = true;
// It's OK for the value to be null, but some "Value" param must be supplied
// because it serves no useful purpose to have a <CascadingValue> otherwise.
if (!hasSuppliedValue)
{
throw new ArgumentException($"Missing required parameter '{nameof(Value)}' for component '{GetType().Name}'.");
}
// Rendering is most efficient when things are queued from rootmost to leafmost.View on GitHub (pinned to 294cab2f9b)
Solutions
- Check the parameter name spelling — only Value, ChildContent, Name, IsFixed are valid.
- If you intended a typed cascading source with more options, use CascadingValueSource<T> registered in DI instead.
Example fix
// before
<CascadingValue ValueData="@_value">
<Child />
</CascadingValue>
// after
<CascadingValue Value="@_value">
<Child />
</CascadingValue> Defensive patterns
Strategy: validation
Validate before calling
var allowed = new[] { "Value", "ChildContent", "Name", "IsFixed" };
foreach (var p in parameters)
if (!allowed.Contains(p.Name))
throw new ArgumentException($"Unknown CascadingValue parameter: {p.Name}"); Prevention
- Only use Value, ChildContent, Name, IsFixed on CascadingValue.
- Double-check parameter spelling in markup.
When it happens
Trigger: Passing an unrecognized parameter in markup like <CascadingValue SomeOtherProp="x">, or programmatically building a parameter dictionary with a wrong key. The rejection happens in the else branch at CascadingValue.cs:88-91.
Common situations: Typo in a parameter name (e.g., <CascadingValue Values=...> instead of Value); confusing CascadingValue with CascadingValueSource API; attempting to pass extra configuration.
Related errors
- Missing required parameter '{nameof(Value)}' for component '
- The parameter '{nameof(Name)}' for component '{nameof(Cascad
- The value of {nameof(IsFixed)} cannot be changed dynamically
- Cannot notify about changes because the {GetType()} is confi
- {nameof(DynamicComponent)} does not accept a parameter with
AI-assisted analysis of dotnet/aspnetcore@294cab2f9b (2026-08-06).
Data as JSON: /api/errors/bd2e054d774129f2.
Report an issue: GitHub.