{"record":{"id":"3172197b374095c8","repo":"unoplatform/uno","slug":"unknowntypename","errorCode":null,"errorMessage":"unknownTypeName","messagePattern":"unknownTypeName","errorType":"validation","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"src/SourceGenerators/System.Xaml/System.Xaml/XamlType.cs","lineNumber":89,"sourceCode":"\t\t\t\tPreferredXamlNamespace = XamlLanguage.Xaml2006Namespace;\n\t\t\t} else {\n\t\t\t\tName = GetXamlName (type);\n\t\t\t\tPreferredXamlNamespace = schemaContext.GetXamlNamespace (type.Namespace) ?? String.Format (CultureInfo.InvariantCulture, \"clr-namespace:{0};assembly={1}\", type.Namespace, type.Assembly.GetName ().Name);\n\t\t\t}\n\t\t\tif (type.IsGenericType) {\n\t\t\t\tTypeArguments = new List<XamlType> ();\n\t\t\t\tforeach (var gta in type.GetGenericArguments ())\n\t\t\t\t\tTypeArguments.Add (schemaContext.GetXamlType (gta));\n\t\t\t}\n\t\t}\n\n\t\tpublic XamlType (string unknownTypeNamespace, string unknownTypeName, IList<XamlType> typeArguments, XamlSchemaContext schemaContext)\n\t\t\t: this (schemaContext, null)\n\t\t{\n\t\t\tif (unknownTypeNamespace == null)\n\t\t\t\tthrow new ArgumentNullException (\"unknownTypeNamespace\");\n\t\t\tif (unknownTypeName == null)\n\t\t\t\tthrow new ArgumentNullException (\"unknownTypeName\");\n\t\t\tif (schemaContext == null)\n\t\t\t\tthrow new ArgumentNullException (\"schemaContext\");\n\n\t\t\ttype = typeof (object);\n\t\t\tName = unknownTypeName;\n\t\t\tPreferredXamlNamespace = unknownTypeNamespace;\n\t\t\tTypeArguments = typeArguments != null && typeArguments.Count == 0 ? null : typeArguments;\n//\t\t\texplicit_ns = unknownTypeNamespace;\n\t\t}\n\n\t\tprotected XamlType (string typeName, IList<XamlType> typeArguments, XamlSchemaContext schemaContext)\n\t\t\t: this (String.Empty, typeName, typeArguments, schemaContext)\n\t\t{\n\t\t}\n\n\t\tXamlType (XamlSchemaContext schemaContext, XamlTypeInvoker invoker)\n\t\t{\n\t\t\tif (schemaContext == null)","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/unoplatform/uno/blob/04183404888ea21b4e5bfa3493e8d5f15e972c3a/src/SourceGenerators/System.Xaml/System.Xaml/XamlType.cs#L71-L107","documentation":"The XamlType(string unknownTypeNamespace, string unknownTypeName, ...) constructor throws ArgumentNullException('unknownTypeName') when the local type name argument is null. The name is assigned directly to the XamlType.Name property and used for serialization, so it must be present.","triggerScenarios":"Constructing an unknown XamlType without a name — e.g. when parsing failed to extract a local name from a malformed element, or when a caller passes a null name variable.","commonSituations":"Malformed XAML where the element tag has no name; programmatic XamlType construction with incomplete metadata; tests exercising validation.","solutions":["Ensure the type name is extracted and non-null before constructing the XamlType.","Treat a missing name as a fatal parse error and report it to the user instead of constructing a nameless XamlType.","Default to a placeholder name (e.g. 'Unknown') if you intentionally need an opaque placeholder type."],"exampleFix":"// before\nvar xt = new XamlType(ns, null, typeArgs, sctx);\n\n// after\nif (typeName == null) throw new ArgumentException(\"XAML element is missing a type name\");\nvar xt = new XamlType(ns, typeName, typeArgs, sctx);","handlingStrategy":"validation","validationCode":"if (string.IsNullOrEmpty(unknownTypeName)) throw new ArgumentException(\"type name required\");\nvar xt = new XamlType(unknownTypeNamespace, unknownTypeName, typeArguments, schemaContext);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat a missing local name as a fatal parse error rather than constructing a nameless type.","Add a schema/guard check that the parser always emits a non-empty name token."],"tags":["xaml","argument-null","xamltype"],"backgroundTag":null,"analyzedSha":"04183404888ea21b4e5bfa3493e8d5f15e972c3a","analyzedAt":"2026-08-13T21:08:11.651Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}