{"record":{"id":"295cac5a07adc0ec","repo":"unoplatform/uno","slug":"the-property-ownertype-propertyname-is-unknown","errorCode":null,"errorMessage":"The property {ownerType}.{propertyName} is unknown. Line number: {lineNumber}, Line position: {linePosition}, Caller: {caller}, File: {_fileDefinition.FilePath}","messagePattern":"The property (.+?)\\.(.+?) is unknown\\. Line number: (.+?), Line position: (.+?), Caller: (.+?), File: (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/SourceGenerators/Uno.UI.SourceGenerators/XamlGenerator/XamlFileGenerator.Reflection.cs","lineNumber":263,"sourceCode":"\n\t\t\t\tcase Accessibility.Internal:\n\t\t\t\t\treturn \"internal\";\n\n\t\t\t\tcase Accessibility.Public:\n\t\t\t\t\treturn \"public\";\n\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new NotSupportedException($\"Field modifier {accessibility} is not supported\");\n\t\t\t}\n\t\t}\n\n\t\tprivate INamedTypeSymbol GetPropertyTypeByOwnerSymbol(INamedTypeSymbol ownerType, string propertyName, int lineNumber, int linePosition, [CallerMemberName] string caller = \"\")\n\t\t{\n\t\t\tvar definition = _metadataHelper.FindPropertyTypeByOwnerSymbol(ownerType, propertyName);\n\n\t\t\tif (definition == null)\n\t\t\t{\n\t\t\t\tthrow new Exception($\"The property {ownerType}.{propertyName} is unknown. Line number: {lineNumber}, Line position: {linePosition}, Caller: {caller}, File: {_fileDefinition.FilePath}\");\n\t\t\t}\n\n\t\t\treturn definition;\n\t\t}\n\n\t\tprivate ISymbol? FindProperty(XamlMember xamlMember)\n\t\t{\n\t\t\tvar type = FindType(xamlMember.DeclaringType);\n\t\t\treturn _metadataHelper.FindPropertyByOwnerSymbol(type, xamlMember.Name);\n\t\t}\n\n\t\tprivate ISymbol? FindProperty(XamlMemberDefinition xamlMemberDefinition)\n\t\t{\n\t\t\tvar declaringType = xamlMemberDefinition.Member.DeclaringType;\n\n\t\t\tvar type = IsCustomMarkupExtensionType(declaringType)\n\t\t\t\t? GetMarkupExtensionType(declaringType)\n\t\t\t\t: FindType(xamlMemberDefinition.Member.DeclaringType);","sourceCodeStart":245,"sourceCodeEnd":281,"githubUrl":"https://github.com/unoplatform/uno/blob/04183404888ea21b4e5bfa3493e8d5f15e972c3a/src/SourceGenerators/Uno.UI.SourceGenerators/XamlGenerator/XamlFileGenerator.Reflection.cs#L245-L281","documentation":"Thrown by GetPropertyTypeByOwnerSymbol when the metadata helper's FindPropertyTypeByOwnerSymbol returns null, meaning no property with the given name exists on the resolved owner type. The exception message includes line number, line position, caller method, and file path for diagnosis.","triggerScenarios":"XAML sets or binds to a property name that does not exist on the resolved type — e.g. <TextBlock NonExistentProperty=\"value\" /> where the type has no such property.","commonSituations":"Typo in a property name in XAML; the property was renamed or removed in a newer version of the type; the xmlns maps to a different type than expected; a custom control's property was misspelled.","solutions":["Check the line/column in the error message and verify the property name matches a real property on the target type.","If the property was renamed, update the XAML to use the new name.","Verify the xmlns prefix resolves to the correct assembly and type.","If it is a custom control, ensure the property is public and the control assembly is referenced."],"exampleFix":"<!-- before -->\n<TextBox HeaderText=\"My Title\" />\n<!-- after (correct property name) -->\n<TextBox Header=\"My Title\" />","handlingStrategy":"validation","validationCode":"// Verify the property exists on the type before using it in XAML:\n// var prop = typeof(OwnerType).GetProperty(\"PropertyName\",\n//     BindingFlags.Public | BindingFlags.Instance);\n// if (prop == null) Console.WriteLine(\"Property not found — check XAML\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use IntelliSense/IDE completion to verify property names in XAML.","After renaming a property, search XAML files for the old name.","Verify xmlns prefixes map to the expected types and assemblies."],"tags":["reflection","xaml","source-generator","property-resolution"],"backgroundTag":null,"analyzedSha":"04183404888ea21b4e5bfa3493e8d5f15e972c3a","analyzedAt":"2026-08-13T21:08:11.651Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}