unoplatform/uno · error · Exception
The property {ownerType}.{propertyName} is unknown. Line num
Error message
The property {ownerType}.{propertyName} is unknown. Line number: {lineNumber}, Line position: {linePosition}, Caller: {caller}, File: {_fileDefinition.FilePath} What it means
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.
Source
Thrown at src/SourceGenerators/Uno.UI.SourceGenerators/XamlGenerator/XamlFileGenerator.Reflection.cs:263
case Accessibility.Internal:
return "internal";
case Accessibility.Public:
return "public";
default:
throw new NotSupportedException($"Field modifier {accessibility} is not supported");
}
}
private INamedTypeSymbol GetPropertyTypeByOwnerSymbol(INamedTypeSymbol ownerType, string propertyName, int lineNumber, int linePosition, [CallerMemberName] string caller = "")
{
var definition = _metadataHelper.FindPropertyTypeByOwnerSymbol(ownerType, propertyName);
if (definition == null)
{
throw new Exception($"The property {ownerType}.{propertyName} is unknown. Line number: {lineNumber}, Line position: {linePosition}, Caller: {caller}, File: {_fileDefinition.FilePath}");
}
return definition;
}
private ISymbol? FindProperty(XamlMember xamlMember)
{
var type = FindType(xamlMember.DeclaringType);
return _metadataHelper.FindPropertyByOwnerSymbol(type, xamlMember.Name);
}
private ISymbol? FindProperty(XamlMemberDefinition xamlMemberDefinition)
{
var declaringType = xamlMemberDefinition.Member.DeclaringType;
var type = IsCustomMarkupExtensionType(declaringType)
? GetMarkupExtensionType(declaringType)
: FindType(xamlMemberDefinition.Member.DeclaringType);View on GitHub (pinned to 0418340488)
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.
Example fix
<!-- before --> <TextBox HeaderText="My Title" /> <!-- after (correct property name) --> <TextBox Header="My Title" />
Defensive patterns
Strategy: validation
Validate before calling
// Verify the property exists on the type before using it in XAML:
// var prop = typeof(OwnerType).GetProperty("PropertyName",
// BindingFlags.Public | BindingFlags.Instance);
// if (prop == null) Console.WriteLine("Property not found — check XAML"); Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Field modifier {accessibility} is not supported
- The {0} string passed in the colorString argument is not a r
- Member '{0}' could not be resolved to a static member
- Attempt to set value from read-only property {0}
- Current operation is valid only when the underlying type on
AI-assisted analysis of unoplatform/uno@0418340488 (2026-08-13).
Data as JSON: /api/errors/295cac5a07adc0ec.
Report an issue: GitHub.