{"record":{"id":"7b85d9b0b79307e0","repo":"dotnet/aspnetcore","slug":"the-property-parametername-on-component-type-7b85d9","errorCode":null,"errorMessage":"The property '{parameterName}' on component type '{targetType.FullName}' cannot be set using a cascading value.","messagePattern":"The property '(.+?)' on component type '(.+?)' cannot be set using a cascading value\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Components/Components/src/Reflection/ComponentProperties.cs","lineNumber":232,"sourceCode":"        {\n            throw new InvalidOperationException(\n                $\"Object of type '{targetType.FullName}' does not have a property \" +\n                $\"matching the name '{parameterName}'.\");\n        }\n    }\n\n    [DoesNotReturn]\n    private static void ThrowForSettingCascadingParameterWithNonCascadingValue(Type targetType, string parameterName)\n    {\n        throw new InvalidOperationException(\n            $\"The property '{parameterName}' on component type '{targetType.FullName}' cannot be set \" +\n            $\"explicitly because it only accepts cascading values.\");\n    }\n\n    [DoesNotReturn]\n    private static void ThrowForSettingParameterWithCascadingValue(Type targetType, string parameterName)\n    {\n        throw new InvalidOperationException(\n            $\"The property '{parameterName}' on component type '{targetType.FullName}' cannot be set \" +\n            $\"using a cascading value.\");\n    }\n\n    [DoesNotReturn]\n    private static void ThrowForCaptureUnmatchedValuesConflict(Type targetType, string parameterName, Dictionary<string, object> unmatched)\n    {\n        throw new InvalidOperationException(\n            $\"The property '{parameterName}' on component type '{targetType.FullName}' cannot be set explicitly \" +\n            $\"when also used to capture unmatched values. Unmatched values:\" + Environment.NewLine +\n            string.Join(Environment.NewLine, unmatched.Keys));\n    }\n\n    [DoesNotReturn]\n    private static void ThrowForMultipleCaptureUnmatchedValuesParameters([DynamicallyAccessedMembers(Component)] Type targetType)\n    {\n        var propertyNames = new List<string>();\n        foreach (var property in targetType.GetProperties(BindablePropertyFlags))","sourceCodeStart":214,"sourceCodeEnd":250,"githubUrl":"https://github.com/dotnet/aspnetcore/blob/3600ca084e9c8b5f4174fc5e747f4c52d2100806/src/Components/Components/src/Reflection/ComponentProperties.cs#L214-L250","documentation":"ThrowForSettingParameterWithCascadingValue is the inverse of 291: the framework attempted to deliver a cascading value to a property annotated with [Parameter] (ParameterAttribute) that does not accept cascading parameters (no CascadingParameterAttributeBase). Regular [Parameter] properties only receive explicitly-supplied values; routing a cascade into them is a type-of-binding mismatch.","triggerScenarios":"Internally, when the cascading-value dispatch tries to write to a [Parameter]-only property. A custom renderer or test harness that pushes a cascading value at a property marked [Parameter]. Misconfiguration where a property intended to be cascading is annotated only with [Parameter].","commonSituations":"Annotating a property with [Parameter] when it should have been [CascadingParameter], then expecting a CascadingValue to populate it. Test infrastructure that drives cascading values into normal parameters. Component libraries where the attribute was applied incorrectly.","solutions":["If the property should receive a cascading value, replace [Parameter] with [CascadingParameter] (and a matching Name if needed).","If the property should remain a direct parameter, supply the value explicitly rather than via CascadingValue.","Audit the property's attributes: a property should not be marked [Parameter] if it is meant to consume cascading values."],"exampleFix":"// before\n// Theme intended as cascading, but marked [Parameter]\n[Parameter] public string? Theme { get; set; }\n\n// after\n[CascadingParameter] public string? Theme { get; set; }","handlingStrategy":"validation","validationCode":"// Ensure a property meant to consume cascading values is annotated accordingly.\nvar prop = typeof(MyComponent).GetProperty(\"Theme\");\nbool acceptsCascade = prop?.GetCustomAttributes()\n    .OfType<CascadingParameterAttributeBase>().Any() == true;\nif (!acceptsCascade)\n    throw new InvalidOperationException(\"Theme cannot accept a cascading value; mark [CascadingParameter].\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use [CascadingParameter] for properties that consume cascading values.","Reserve [Parameter] for explicitly-supplied values.","Review attribute usage whenever changing a property's data source."],"tags":["blazor","parameters","cascading-values","binding"],"backgroundTag":null,"analyzedSha":"3600ca084e9c8b5f4174fc5e747f4c52d2100806","analyzedAt":"2026-08-11T16:32:30.678Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}