{"record":{"id":"feefe990e7992f31","repo":"unoplatform/uno","slug":"assemblyname","errorCode":null,"errorMessage":"assemblyName","messagePattern":"assemblyName","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"src/SourceGenerators/System.Xaml/System.Xaml.Permissions/XamlAccessLevel.cs","lineNumber":47,"sourceCode":"namespace Uno.Xaml.Permissions\n{\n\t[SerializableAttribute]\n\tpublic class XamlAccessLevel\n\t{\n\t\tpublic static XamlAccessLevel AssemblyAccessTo (Assembly assembly)\n\t\t{\n\t\t\tif (assembly == null)\n\t\t\t{\n\t\t\t\tthrow new ArgumentNullException (\"assembly\");\n\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)","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/unoplatform/uno/blob/04183404888ea21b4e5bfa3493e8d5f15e972c3a/src/SourceGenerators/System.Xaml/System.Xaml.Permissions/XamlAccessLevel.cs#L29-L65","documentation":"Thrown by XamlAccessLevel.AssemblyAccessTo(AssemblyName) when the assemblyName argument is null. The AssemblyName is stored directly as the access target identity, so null is rejected immediately.","triggerScenarios":"Calling AssemblyAccessTo with a null AssemblyName, e.g. constructed from a failed AssemblyName.GetAssemblyName(path) call.","commonSituations":"Parsing assembly references from config where a name failed to parse; reflection-derived AssemblyName that came back null; copy-paste using the wrong overload.","solutions":["Build the AssemblyName from a known-good string or resolved assembly.","Use AssemblyAccessTo(Assembly) if you have the loaded Assembly instead.","Null-check the AssemblyName before calling."],"exampleFix":"// before\nvar an = new AssemblyName(badRef); // may throw/null\nvar lvl = XamlAccessLevel.AssemblyAccessTo((AssemblyName)null);\n\n// after\nvar an = new AssemblyName(\"MyLib, Version=1.0.0.0\");\nvar lvl = XamlAccessLevel.AssemblyAccessTo(an);","handlingStrategy":"validation","validationCode":"var an = new AssemblyName(reference);\n// AssemblyName ctor throws on bad input; ensure reference is valid\nvar lvl = XamlAccessLevel.AssemblyAccessTo(an);","typeGuard":"static bool IsAssemblyNameValid(AssemblyName a) => a != null;","tryCatchPattern":null,"preventionTips":["Construct AssemblyName from a known-good reference string.","Use AssemblyAccessTo(Assembly) when you already have the loaded assembly.","Validate config-supplied assembly references at startup."],"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"}