{"record":{"id":"0552051952fde502","repo":"dotnet/maui","slug":"xc0007","errorCode":"XC0007","errorMessage":"Enum value not found for \"{0}\".","messagePattern":"Enum value not found for \"(.+?)\"\\.","errorType":"exception","errorClass":"BuildException","httpStatus":null,"severity":"error","filePath":"src/Controls/src/Build.Tasks/NodeILExtensions.cs","lineNumber":407,"sourceCode":"\t\t\t\t\t\t\t\ti |= (int)field.Constant;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"System.UInt32\":\n\t\t\t\t\t\t\t\tui |= (uint)field.Constant;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"System.Int64\":\n\t\t\t\t\t\t\t\tl |= (long)field.Constant;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"System.UInt64\":\n\t\t\t\t\t\t\t\tul |= (ulong)field.Constant;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfound = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!found)\n\t\t\t\tthrow new BuildException(BuildExceptionCode.EnumValueMissing, lineInfo, null, value);\n\n\t\t\tswitch (typeRef.FullName)\n\t\t\t{\n\t\t\t\tcase \"System.Byte\":\n\t\t\t\t\treturn Create(Ldc_I4, (int)b);\n\t\t\t\tcase \"System.SByte\":\n\t\t\t\t\treturn Create(Ldc_I4, (int)sb);\n\t\t\t\tcase \"System.Int16\":\n\t\t\t\t\treturn Create(Ldc_I4, (int)s);\n\t\t\t\tcase \"System.UInt16\":\n\t\t\t\t\treturn Create(Ldc_I4, (int)us);\n\t\t\t\tcase \"System.Int32\":\n\t\t\t\t\treturn Create(Ldc_I4, (int)i);\n\t\t\t\tcase \"System.UInt32\":\n\t\t\t\t\treturn Create(Ldc_I4, (uint)ui);\n\t\t\t\tcase \"System.Int64\":\n\t\t\t\t\treturn Create(Ldc_I4, (long)l);\n\t\t\t\tcase \"System.UInt64\":","sourceCodeStart":389,"sourceCodeEnd":425,"githubUrl":"https://github.com/dotnet/maui/blob/f377ff1c5ee04d334d8a925f50c83a6b7afddf03/src/Controls/src/Build.Tasks/NodeILExtensions.cs#L389-L425","documentation":"Thrown after the XAML compiler iterates every field of the target enum and none matches the trimmed value(s) supplied in the attribute. The `found` flag stays false, meaning the literal name written in XAML does not exist as a member of the resolved enum type.","triggerScenarios":"An attribute resolves to an enum but the value string (after split-on-comma and trim) matches no field name on that enum, e.g. `Orientation=\"Horz\"` where the enum defines `Horizontal`.","commonSituations":"Typo in an enum member name; the member was renamed or removed in a newer package version; the wrong enum type was resolved due to a namespace/assembly mismatch.","solutions":["Verify the exact enum member name (names are case-sensitive).","Confirm which enum type the property actually expects and that the correct assembly/namespace is referenced.","Rebuild the project referencing the assembly that defines the enum so the compiler sees the current members."],"exampleFix":"<!-- before -->\n<StackLayout Orientation=\"Horz\" />\n\n<!-- after -->\n<StackLayout Orientation=\"Horizontal\" />","handlingStrategy":"validation","validationCode":"// Verify the value is a defined member name (case-sensitive) of the expected enum\nstatic bool IsDefinedEnumName(Type enumType, string xamlValue)\n    => xamlValue.Split(',').Select(v => v.Trim())\n        .All(v => Enum.GetNames(enumType).Contains(v));","typeGuard":"static bool IsValidEnumValue<T>(string value) where T : struct, Enum\n    => value.Split(',').Select(v => v.Trim()).All(v => Enum.IsDefined(typeof(T), v));","tryCatchPattern":null,"preventionTips":["Cross-check enum member names against the source enum (names are case-sensitive).","After upgrading a package, re-scan XAML for enum values that may have been renamed.","Keep the referenced assembly current so the compiler sees the latest members."],"tags":["xaml","xamlc","enum"],"backgroundTag":null,"analyzedSha":"f377ff1c5ee04d334d8a925f50c83a6b7afddf03","analyzedAt":"2026-08-13T14:26:18.069Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}