{"record":{"id":"8a7e3d635ad2abc7","repo":"unoplatform/uno","slug":"the-type-fullyqualifiedmetadataname-is-not-fou","errorCode":null,"errorMessage":"The type '{fullyQualifiedMetadataName}' is not found.","messagePattern":"The type '(.+?)' is not found\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/SourceGenerators/Uno.UI.SourceGenerators/ImplementedRoutedEvents/ImplementedRoutedEventsGenerator.cs","lineNumber":118,"sourceCode":"\t\t\t_events.Add(\"OnPreviewKeyUp\", keyRoutedEventArgs);\n\t\t\t_events.Add(\"OnKeyDown\", keyRoutedEventArgs);\n\t\t\t_events.Add(\"OnKeyUp\", keyRoutedEventArgs);\n\n\t\t\tvar characterReceivedRoutedEventArgs = GetRequiredTypeByMetadataName(XamlConstants.Types.CharacterReceivedRoutedEventArgs);\n\t\t\t_events.Add(\"OnCharacterReceived\", characterReceivedRoutedEventArgs);\n\n\t\t\tvar routedEventArgs = GetRequiredTypeByMetadataName(XamlConstants.Types.RoutedEventArgs);\n\t\t\t_events.Add(\"OnLostFocus\", routedEventArgs);\n\t\t\t_events.Add(\"OnGotFocus\", routedEventArgs);\n\n\t\t\tvar bringIntoViewRequestedEventArgs = GetRequiredTypeByMetadataName(XamlConstants.Types.BringIntoViewRequestedEventArgs);\n\t\t\t_events.Add(\"OnBringIntoViewRequested\", bringIntoViewRequestedEventArgs);\n\t\t}\n\n\t\tprivate INamedTypeSymbol GetRequiredTypeByMetadataName(string fullyQualifiedMetadataName)\n\t\t{\n\t\t\tvar type = _context.Compilation.GetTypeByMetadataName(fullyQualifiedMetadataName);\n\t\t\treturn type ?? throw new InvalidOperationException($\"The type '{fullyQualifiedMetadataName}' is not found.\");\n\t\t}\n\n\t\tpublic override void VisitModule(IModuleSymbol symbol) => VisitNamespace(symbol.GlobalNamespace);\n\n\t\tpublic override void VisitNamedType(INamedTypeSymbol symbol)\n\t\t{\n\t\t\tforeach (var type in symbol.GetTypeMembers())\n\t\t\t{\n\t\t\t\tVisitNamedType(type);\n\t\t\t}\n\n\t\t\tProcessType(symbol);\n\t\t}\n\n\t\tpublic override void VisitNamespace(INamespaceSymbol symbol)\n\t\t{\n\t\t\tforeach (var n in symbol.GetNamespaceMembers())\n\t\t\t{","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/unoplatform/uno/blob/04183404888ea21b4e5bfa3493e8d5f15e972c3a/src/SourceGenerators/Uno.UI.SourceGenerators/ImplementedRoutedEvents/ImplementedRoutedEventsGenerator.cs#L100-L136","documentation":"GetRequiredTypeByMetadataName resolves a fully-qualified type (RoutedEventArgs, BringIntoViewRequestedEventArgs, etc.) via compilation.GetTypeByMetadataName and throws InvalidOperationException if it returns null. A null return means the type is absent from the compilation — its declaring assembly is not referenced, or the metadata name constant is wrong.","triggerScenarios":"The generator requests a routed-event-arg type that is not present in the compilation, e.g. Microsoft.UI.Xaml.RoutedEventArgs when the Microsoft.UI.Xaml reference is missing.","commonSituations":"Building a project that lacks the Microsoft.UI.Xaml reference; after a namespace/type rename in a dependency; mismatched Uno SDK version where the type moved.","solutions":["Add/restore the PackageReference or ProjectReference that provides the missing type (e.g. Microsoft.UI.Xaml / the Uno Microsoft.UI package).","Check the reported metadata name against the current Uno/WinUI version in case it was renamed.","Run dotnet restore and rebuild to re-resolve references."],"exampleFix":"<!-- before: Microsoft.UI.Xaml not referenced -->\n<!-- after -->\n<ItemGroup>\n  <PackageReference Include=\"Microsoft.UI.Xaml\" Version=\"...\" />\n</ItemGroup>","handlingStrategy":"validation","validationCode":"// Before building, confirm the routed-event-arg types resolve in the compilation\nvar names = new[] { \"Microsoft.UI.Xaml.RoutedEventArgs\", \"Microsoft.UI.Xaml.BringIntoViewRequestedEventArgs\" };\nforeach (var n in names)\n    if (Type.GetType(n) == null) Console.WriteLine($\"WARN: {n} not found; add the Microsoft.UI.Xaml reference.\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the Microsoft.UI.Xaml / Uno Microsoft.UI reference present in projects that use XAML routed events.","After dependency upgrades, verify type names against the current version."],"tags":["roslyn","source-generator","type-resolution","routed-events","xaml"],"backgroundTag":null,"analyzedSha":"04183404888ea21b4e5bfa3493e8d5f15e972c3a","analyzedAt":"2026-08-13T21:08:11.651Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}