{"record":{"id":"8bd257a652a4c951","repo":"dotnet/wpf","slug":"sr-badinternalsvisibleto1","errorCode":null,"errorMessage":"SR.BadInternalsVisibleTo1","messagePattern":"SR\\.BadInternalsVisibleTo1","errorType":"exception","errorClass":"XamlSchemaException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/MS/Impl/XmlNsInfo.cs","lineNumber":283,"sourceCode":"            }\n            else\n            {\n                Attribute[] attributes = Attribute.GetCustomAttributes(assembly, typeof(InternalsVisibleToAttribute));\n                for (int i = 0; i < attributes.Length; i++)\n                {\n                    InternalsVisibleToAttribute ivAttrib = (InternalsVisibleToAttribute)attributes[i];\n                    LoadInternalsVisibleToHelper(result, ivAttrib.AssemblyName, assembly);\n                }\n            }\n\n            return result;\n        }\n\n        private void LoadInternalsVisibleToHelper(List<AssemblyName> result, string assemblyName, Assembly assembly)\n        {\n            if (assemblyName is null)\n            {\n                throw new XamlSchemaException(SR.Format(SR.BadInternalsVisibleTo1, assembly.FullName));\n            }\n\n            try\n            {\n                result.Add(new AssemblyName(assemblyName));\n            }\n            catch (ArgumentException ex)\n            {\n                throw new XamlSchemaException(SR.Format(SR.BadInternalsVisibleTo2, assemblyName, assembly.FullName), ex);\n            }\n\n            // AssemblyName.ctor throws FLE on malformed assembly name\n            catch (FileLoadException ex)\n            {\n                throw new XamlSchemaException(SR.Format(SR.BadInternalsVisibleTo2, assemblyName, assembly.FullName), ex);\n            }\n        }\n","sourceCodeStart":265,"sourceCodeEnd":301,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/MS/Impl/XmlNsInfo.cs#L265-L301","documentation":"LoadInternalsVisibleToHelper throws this XamlSchemaException when an InternalsVisibleToAttribute on the assembly has a null AssemblyName, making the attribute unparseable while collecting friend-assembly names for XAML schema context. The attribute data itself is corrupt.","triggerScenarios":"Thrown at src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/MS/Impl/XmlNsInfo.cs:283 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the assembly's InternalsVisibleToAttribute has a valid AssemblyName string","Fix the [assembly: InternalsVisibleTo(...)] declaration in the friend assembly","Verify the attribute value parses as an AssemblyName"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"81131a70a4c573cd62748a5c36908fc4d662daa9","analyzedAt":"2026-09-14T10:12:48.479Z","contentChangedAt":"2026-09-14T10:12:48.479Z","schemaVersion":2},"datasetVersion":"2026-09-21T21:30:21.729Z"}