dotnet/maui · error · BuildException
XC0009
XC0009
Error message
No property, BindableProperty, or event found for "{0}", or mismatching type between value and property. What it means
Thrown by SetStdtask after the compiler exhausts SetValue (BindableProperty), Set (plain property), and Add (existing collection) and none succeed for localName. It means no matching property, BindableProperty, or event exists on the type — or the value's type does not match the target.
Source
Thrown at src/Controls/src/Build.Tasks/SetPropertiesVisitor.cs:1388
return SetDynamicResource(parent, bpRef, valueNode as ElementNode, iXmlLineInfo, context);
//If Value is a BindingBase and target is a BP, SetBinding
if (CanSetBinding(bpRef, valueNode, context))
return SetBinding(parent, bpRef, valueNode as ElementNode, iXmlLineInfo, context);
//If it's a BP, SetValue ()
if (CanSetValue(bpRef, attached, valueNode, iXmlLineInfo, context))
return SetValue(parent, bpRef, valueNode, iXmlLineInfo, context);
//If it's a property, set it
if (CanSet(parent, localName, valueNode, context))
return Set(parent, localName, valueNode, iXmlLineInfo, context);
//If it's an already initialized property, add to it
if (CanAdd(parent, propertyName, valueNode, iXmlLineInfo, context))
return Add(parent, propertyName, valueNode, iXmlLineInfo, context);
throw new BuildException(MemberResolution, iXmlLineInfo, null, localName);
}
public static IEnumerable<Instruction> GetPropertyValue(VariableDefinition parent, XmlName propertyName, ILContext context, IXmlLineInfo lineInfo, out TypeReference propertyType)
{
var module = context.Body.Method.Module;
var localName = propertyName.LocalName;
var bpRef = GetBindablePropertyReference(parent, propertyName.NamespaceURI, ref localName, out var attached, context, lineInfo);
//If it's a BP, GetValue ()
if (CanGetValue(parent, bpRef, attached, lineInfo, context, out _))
return GetValue(parent, bpRef, lineInfo, context, out propertyType);
//If it's a property, get it
if (CanGet(parent, localName, context, out _))
return Get(parent, localName, lineInfo, context, out propertyType);
throw new BuildException(PropertyResolution, lineInfo, null, localName, parent.VariableType.FullName);
}View on GitHub (pinned to f377ff1c5e)
Solutions
- Verify the member name exists and is public on the resolved type.
- For BindableProperties, confirm the static `<Name>Property` field exists and is public/internal.
- Check the value type matches the property/event (e.g. event handler signature, enum value).
- Ensure the correct xmlns/namespace and Maui version are referenced.
Example fix
<!-- before --> <Button Clic="OnClick" /> <!-- after --> <Button Clicked="OnClick" />
Defensive patterns
Strategy: validation
Validate before calling
// Confirm the member resolves as a property, BindableProperty, or event
static bool MemberResolves(Type owner, string name)
=> owner.GetProperty(name) != null
|| owner.GetEvent(name) != null
|| owner.GetField(name + "Property") != null; Prevention
- Verify property/event names exist and are public before referencing them in XAML.
- Ensure BindableProperty fields follow the `<Name>Property` naming and are public/internal.
- Confirm value types match the property/event signature.
When it happens
Trigger: Setting an attribute/element whose name does not resolve to any public property, BindableProperty, or event on the parent type, or whose value type mismatches, e.g. `Clicked` on a type without that event or a misspelled property.
Common situations: Misspelled property/event name; attached BindableProperty field missing the `...Property` suffix or not public; value type incompatible with the property; namespace changed in a newer Maui version.
Related errors
AI-assisted analysis of dotnet/maui@f377ff1c5e (2026-08-13).
Data as JSON: /api/errors/e2fb68aa2de7b5b3.
Report an issue: GitHub.