{"record":{"id":"37f49553cffe3683","repo":"unoplatform/uno","slug":"assemblyqualifiedtypename","errorCode":null,"errorMessage":"assemblyQualifiedTypeName","messagePattern":"assemblyQualifiedTypeName","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"src/SourceGenerators/System.Xaml/System.Xaml.Permissions/XamlAccessLevel.cs","lineNumber":57,"sourceCode":"\t\t\t}\n\n\t\t\treturn new XamlAccessLevel (assembly.GetName ());\n\t\t}\n\t\tpublic static XamlAccessLevel AssemblyAccessTo (AssemblyName assemblyName)\n\t\t{\n\t\t\tif (assemblyName == null)\n\t\t\t{\n\t\t\t\tthrow new ArgumentNullException (\"assemblyName\");\n\t\t\t}\n\n\t\t\treturn new XamlAccessLevel (assemblyName);\n\t\t}\n\n\t\tpublic static XamlAccessLevel PrivateAccessTo (string assemblyQualifiedTypeName)\n\t\t{\n\t\t\tif (assemblyQualifiedTypeName == null)\n\t\t\t{\n\t\t\t\tthrow new ArgumentNullException (\"assemblyQualifiedTypeName\");\n\t\t\t}\n\n\t\t\treturn new XamlAccessLevel (assemblyQualifiedTypeName);\n\t\t}\n\n\t\tpublic static XamlAccessLevel PrivateAccessTo (Type type)\n\t\t{\n\t\t\tif (type == null)\n\t\t\t{\n\t\t\t\tthrow new ArgumentNullException (\"type\");\n\t\t\t}\n\n\t\t\treturn new XamlAccessLevel (type.AssemblyQualifiedName);\n\t\t}\n\n\t\tinternal XamlAccessLevel (AssemblyName assemblyAccessToAssemblyName)\n\t\t{\n\t\t\tAssemblyAccessToAssemblyName = assemblyAccessToAssemblyName;","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/unoplatform/uno/blob/04183404888ea21b4e5bfa3493e8d5f15e972c3a/src/SourceGenerators/System.Xaml/System.Xaml.Permissions/XamlAccessLevel.cs#L39-L75","documentation":"Thrown by XamlAccessLevel.PrivateAccessTo(string) when the assembly-qualified type name argument is null. The string is stored as the private-access target, so a null would create an unresolvable access level.","triggerScenarios":"Calling PrivateAccessTo with a null type-name string, e.g. from Type.AssemblyQualifiedName being null (possible for certain dynamic or generic types).","commonSituations":"Constructing access levels from types whose AssemblyQualifiedName is null (open generics, anonymous types in some runtimes); config-driven XAML loaders that read type names which can be unset.","solutions":["Pass a fully assembly-qualified type name string and verify it is non-null.","Prefer PrivateAccessTo(Type) when you have the Type instance.","Validate that Type.AssemblyQualifiedName is non-null before forwarding the string."],"exampleFix":"// before\nstring n = someType.AssemblyQualifiedName; // null for open generic\nvar lvl = XamlAccessLevel.PrivateAccessTo(n); // throws\n\n// after\nvar lvl = XamlAccessLevel.PrivateAccessTo(someType);","handlingStrategy":"validation","validationCode":"string n = type.AssemblyQualifiedName;\nif (n == null) throw new InvalidOperationException($\"{type} has no AQN\");\nvar lvl = XamlAccessLevel.PrivateAccessTo(n);","typeGuard":"static bool HasAssemblyQualifiedName(Type t)\n    => t != null && t.AssemblyQualifiedName != null;","tryCatchPattern":null,"preventionTips":["Prefer PrivateAccessTo(Type) when you have the Type instance.","Beware open generics and anonymous types whose AssemblyQualifiedName can be null.","Validate the type-name string before storing or forwarding it."],"tags":["xaml","access-level","permissions","argument-null","uno"],"backgroundTag":null,"analyzedSha":"04183404888ea21b4e5bfa3493e8d5f15e972c3a","analyzedAt":"2026-08-13T21:08:11.651Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}