{"record":{"id":"656e88cc02ea6292","repo":"dotnet/aspnetcore","slug":"object-of-type-targettype-fullname-has-a-prope","errorCode":null,"errorMessage":"Object of type '{targetType.FullName}' has a property matching the name '{parameterName}', but it does not have [Parameter], [CascadingParameter], or any other parameter-supplying attribute.","messagePattern":"Object of type '(.+?)' has a property matching the name '(.+?)', but it does not have \\[Parameter\\], \\[CascadingParameter\\], or any other parameter-supplying attribute\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Components/Components/src/Reflection/ComponentProperties.cs","lineNumber":202,"sourceCode":"        }\n    }\n\n    internal static IEnumerable<PropertyInfo> GetCandidateBindableProperties([DynamicallyAccessedMembers(Component)] Type targetType)\n        => MemberAssignment.GetPropertiesIncludingInherited(targetType, BindablePropertyFlags);\n\n    [DoesNotReturn]\n    private static void ThrowForUnknownIncomingParameterName([DynamicallyAccessedMembers(Component)] Type targetType,\n        string parameterName)\n    {\n        // We know we're going to throw by this stage, so it doesn't matter that the following\n        // reflection code will be slow. We're just trying to help developers see what they did wrong.\n        var propertyInfo = targetType.GetProperty(parameterName, BindablePropertyFlags);\n        if (propertyInfo != null)\n        {\n            if (!propertyInfo.IsDefined(typeof(ParameterAttribute)) &&\n                !propertyInfo.GetCustomAttributes().OfType<CascadingParameterAttributeBase>().Any())\n            {\n                throw new InvalidOperationException(\n                    $\"Object of type '{targetType.FullName}' has a property matching the name '{parameterName}', \" +\n                    $\"but it does not have [Parameter], [CascadingParameter], or any other parameter-supplying attribute.\");\n            }\n            else\n            {\n                // This should not happen\n                throw new InvalidOperationException(\n                    $\"No writer was cached for the property '{propertyInfo.Name}' on type '{targetType.FullName}'.\");\n            }\n        }\n        else\n        {\n            throw new InvalidOperationException(\n                $\"Object of type '{targetType.FullName}' does not have a property \" +\n                $\"matching the name '{parameterName}'.\");\n        }\n    }\n","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/dotnet/aspnetcore/blob/294cab2f9b2e03af6b953820c7ab497c3c8b7ad9/src/Components/Components/src/Reflection/ComponentProperties.cs#L184-L220","documentation":"Thrown by ComponentProperties.ThrowForUnknownIncomingParameterName when an incoming parameter name matches a property on the component, but that property lacks [Parameter], [CascadingParameter], or any other parameter-supplying attribute. The property exists but is not exposed as a parameter.","triggerScenarios":"Passing an attribute/parameter in markup to a child component where the target property is a plain public property not decorated with a parameter attribute.","commonSituations":"Forgetting the [Parameter] attribute; setting a property meant to be internal-only; a name collision with a non-parameter public property; an upgraded component library that removed an attribute.","solutions":["Add [Parameter] to the property if it should be settable from markup.","If the property is not meant to be a parameter, remove that attribute from the markup - non-parameter properties cannot be set declaratively.","Check the component's source/docs to confirm which properties are real parameters."],"exampleFix":"// before\n// Child.razor.cs\npublic string Title { get; set; } // no [Parameter]\n<Child Title=\"Hi\" />\n\n// after\n[Parameter] public string Title { get; set; }","handlingStrategy":"validation","validationCode":"// Confirm a property is a real parameter before passing it in markup/tests.\nstatic bool IsParameter(Type componentType, string propertyName)\n{\n    var p = componentType.GetProperty(propertyName,\n        BindingFlags.Public | BindingFlags.Instance | BindingFlags.IgnoreCase);\n    return p?.GetCustomAttribute<ParameterAttribute>() is not null\n        || p?.GetCustomAttributes().OfType<CascadingParameterAttributeBase>().Any() == true;\n}","typeGuard":"static bool HasParameterAttribute(PropertyInfo p)\n    => p.GetCustomAttribute<ParameterAttribute>() is not null\n       || p.GetCustomAttributes().OfType<CascadingParameterAttributeBase>().Any();","tryCatchPattern":null,"preventionTips":["Decorate settable-from-markup properties with [Parameter].","Do not try to set plain public properties declaratively.","When a library upgrades, verify the parameters you use still carry [Parameter].","Use component XML docs/IntelliSense to confirm which properties are parameters."],"tags":["blazor","parameters","reflection","attributes","rendering"],"analyzedSha":"294cab2f9b2e03af6b953820c7ab497c3c8b7ad9","analyzedAt":"2026-08-06T20:08:02.189Z","schemaVersion":2},"datasetVersion":"2026-08-06T23:17:07.152Z"}