{"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/294cab2f9b2e03af6b953820c7ab497c3c8b7ad9/src/Components/Components/src/Reflection/ComponentProperties.cs#L214-L250","documentation":"Thrown by ComponentProperties.ThrowForSettingParameterWithCascadingValue when a non-cascading ([Parameter]-only) property receives a value through the framework's cascading-value pipeline. This is usually an internal/infrastructure condition rather than a user markup error, because users do not directly route cascading values to specific parameters.","triggerScenarios":"Framework infrastructure (e.g. SupplyParameterFromQuery, custom cascading value suppliers) attempting to deliver a cascading value to a [Parameter]-only property; a misconfigured cascading value supplier targeting the wrong parameter.","commonSituations":"A custom component that supplies cascading values targeting a non-cascading parameter; mixing [SupplyParameterFromQuery] incorrectly; a framework integration bug routing a query/route value as a cascading value to a plain parameter.","solutions":["Verify parameters meant to receive query/route values are attributed correctly (use [SupplyParameterFromQuery] alongside [Parameter]).","Review custom cascading-value providers to ensure they target cascading parameters, not plain parameters.","This usually signals an infrastructure misconfiguration - audit how the cascading value is being supplied.","Check for a framework version regression if the configuration was previously valid."],"exampleFix":"// before: query value routed as cascading to a plain [Parameter]\n[Parameter] public int Page { get; set; } // misconfigured query binding\n\n// after\n[Parameter] [SupplyParameterFromQuery(Name = \"page\")]\npublic int Page { get; set; }","handlingStrategy":"validation","validationCode":"// Ensure query/route-bound parameters carry the right attributes so the framework\n// does not route a cascading value into a plain [Parameter].\nstatic bool IsValidQueryParameter(PropertyInfo p)\n    => p.GetCustomAttribute<ParameterAttribute>() is not null\n       && p.GetCustomAttribute<SupplyParameterFromQueryAttribute>() is not null;","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use [Parameter] together with [SupplyParameterFromQuery] for query-bound parameters, not cascading-value suppliers.","Audit custom cascading-value suppliers to ensure they target [CascadingParameter] properties only.","Treat this error as an infrastructure/config signal - review how the cascading value is supplied.","Watch for framework regressions if a previously-valid setup starts throwing."],"tags":["blazor","cascading-parameter","parameters","infrastructure","rendering"],"analyzedSha":"294cab2f9b2e03af6b953820c7ab497c3c8b7ad9","analyzedAt":"2026-08-06T20:08:02.189Z","schemaVersion":2},"datasetVersion":"2026-08-06T23:17:07.152Z"}