dotnet/maui · error · BuildException
XC0000
XC0000
Error message
Cannot resolve type "{0}". What it means
XamlC error XC0000 (general type resolution). After parsing the type name from the value or from a Style TargetType, the converter calls GetTypeReference; if the named type cannot be resolved against loaded assemblies, it throws XC0000.
Source
Thrown at src/Controls/src/Build.Tasks/CompiledConverters/BindablePropertyConverter.cs:68
typeName = GetTargetTypeName(node.Parent);
}
propertyName = parts[0];
}
else if (parts.Length == 2)
{
var targetType = parts[0];
typeName = TypeArgumentsParser.ParseSingle(targetType, node.NamespaceResolver, (IXmlLineInfo)node);
propertyName = parts[1];
}
else
throw new BuildException(Conversion, node, null, value, typeof(BindableProperty));
if (typeName == null || propertyName == null)
throw new BuildException(Conversion, node, null, value, typeof(BindableProperty));
var typeRef = typeName.GetTypeReference(context.Cache, module, node);
if (typeRef == null)
throw new BuildException(TypeResolution, node, null, typeName);
bpRef = GetBindablePropertyFieldReference(context.Cache, typeRef, propertyName, module);
if (bpRef == null)
throw new BuildException(PropertyResolution, node, null, propertyName, typeRef.Name);
return bpRef;
static XmlType GetTargetTypeName(INode node)
{
var targetType = ((node as ElementNode).Properties[new XmlName("", "TargetType")] as ValueNode)?.Value as string;
return TypeArgumentsParser.ParseSingle(targetType, node.NamespaceResolver, (IXmlLineInfo)node);
}
}
static XmlType FindTypeNameForVisualState(ElementNode parent, IXmlLineInfo lineInfo, ILContext context)
{
//1. parent is VisualState, don't check that
//2. check that the VS is in a VSGView on GitHub (pinned to f377ff1c5e)
Solutions
- Declare or correct the xmlns prefix pointing at the type's CLR namespace and assembly.
- Verify the type name spelling and namespace exactly match the declaring type.
- Add the missing project/assembly reference that contains the type.
Example fix
<!-- before --> <Setter Property="MyView.SpacingProperty" Value="10" /> <!-- 'MyView' is unresolved --> <!-- after --> xmlns:local="clr-namespace:MyLib.Controls;assembly=MyLib" <Setter Property="local:MyView.SpacingProperty" Value="10" />
Defensive patterns
Strategy: validation
Prevention
- Declare every xmlns prefix you reference and keep namespaces current after renames.
- Confirm the assembly containing the type is referenced by the app project.
- Use IDE IntelliSense / XAML diagnostics to catch unresolved types before build.
When it happens
Trigger: The type referenced in the BindableProperty value (or the TargetType that feeds it) does not resolve: wrong name, missing xmlns prefix declaration, or the declaring assembly is not referenced.
Common situations: Forgot to declare xmlns:local/xmlns:custom; typo in the type name; type lives in a project/assembly not referenced by the app; namespace changed after a rename.
Related errors
AI-assisted analysis of dotnet/maui@f377ff1c5e (2026-08-13).
Data as JSON: /api/errors/587fabc70ffc0d72.
Report an issue: GitHub.