{"record":{"id":"c678855f05a059ae","repo":"nopSolutions/nopCommerce","slug":"all-installation-resources-must-have-an-attribute","errorCode":null,"errorMessage":"All installation resources must have an attribute Name=\"Value\".","messagePattern":"All installation resources must have an attribute Name=\"Value\"\\.","errorType":"exception","errorClass":"NopException","httpStatus":null,"severity":"error","filePath":"src/Presentation/Nop.Web/Infrastructure/Installation/InstallationLocalizationService.cs","lineNumber":202,"sourceCode":"                Name = languageName,\r\n                IsDefault = isDefault,\r\n                IsRightToLeft = isRightToLeft,\r\n            };\r\n\r\n            //load resources\r\n            var resources = xmlDocument.SelectNodes(@\"//Language/LocaleResource\");\r\n            if (resources == null)\r\n                continue;\r\n            foreach (XmlNode resNode in resources)\r\n            {\r\n                if (resNode.Attributes == null)\r\n                    continue;\r\n\r\n                var resNameAttribute = resNode.Attributes[\"Name\"];\r\n                var resValueNode = resNode.SelectSingleNode(\"Value\");\r\n\r\n                if (resNameAttribute == null)\r\n                    throw new NopException(\"All installation resources must have an attribute Name=\\\"Value\\\".\");\r\n                var resourceName = resNameAttribute.Value.Trim();\r\n                if (string.IsNullOrEmpty(resourceName))\r\n                    throw new NopException(\"All installation resource attributes 'Name' must have a value.'\");\r\n\r\n                if (resValueNode == null)\r\n                    throw new NopException(\"All installation resources must have an element \\\"Value\\\".\");\r\n                var resourceValue = resValueNode.InnerText.Trim();\r\n\r\n                language.Resources.Add(new InstallationLocaleResource\r\n                {\r\n                    Name = resourceName,\r\n                    Value = resourceValue\r\n                });\r\n            }\r\n\r\n            _availableLanguages.Add(language);\r\n            _availableLanguages = _availableLanguages.OrderBy(l => l.Name).ToList();\r\n\r","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/nopSolutions/nopCommerce/blob/64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2/src/Presentation/Nop.Web/Infrastructure/Installation/InstallationLocalizationService.cs#L184-L220","documentation":"Thrown by InstallationLocalizationService while parsing an installation language XML file: a LocaleResource node under //Language/LocaleResource is missing the 'Name' attribute. Every installation resource element must carry Name=\"...\". This is a data-integrity check on the bundled localization XML.","triggerScenarios":"Parsing an installation language XML (line ~202): resNode.Attributes[\"Name\"] (resNameAttribute) is null for a LocaleResource node, so the loader cannot key the resource.","commonSituations":"A custom/edited language pack XML has a <LocaleResource> element without a Name attribute (malformed export); a translation tool stripped attributes; a manually merged XML introduced a broken node; a corrupted download of the language pack.","solutions":["Open the offending installation language XML file and add the missing Name attribute to every <LocaleResource> element (e.g. <LocaleResource Name=\"Admin.Login\">).","Validate the XML against the official nopCommerce language pack schema/format before loading; diff against a known-good pack.","Re-download or restore the default installation localization files from a clean nopCommerce release."],"exampleFix":"// before (broken XML):\n// <LocaleResource>\n//   <Value>Dashboard</Value>\n// </LocaleResource>\n\n// after (fixed XML):\n// <LocaleResource Name=\"Admin.Dashboard\">\n//   <Value>Dashboard</Value>\n// </LocaleResource>","handlingStrategy":"validation","validationCode":"// Validate the XML structure before loading resources\nforeach (XmlNode resNode in xmlDocument.SelectNodes(\"//Language/LocaleResource\"))\n{\n    if (resNode?.Attributes?[@\"Name\"] == null)\n        throw new NopException($\"LocaleResource at line missing Name attribute.\");\n}","typeGuard":"static bool IsValidResourceNode(XmlNode n) => n?.Attributes?[\"Name\"] != null && n.SelectSingleNode(\"Value\") != null;","tryCatchPattern":"catch (NopException exc) when (exc.Message.Contains(\"attribute Name\"))\n{\n    // report the offending file and skip it rather than failing the whole install\n    _logger.Error($\"Malformed localization XML: {currentFile}\", exc);\n}","preventionTips":["Validate custom language-pack XML against the official format before deploying.","Diff edited packs against a known-good release pack to catch stripped attributes.","Re-download corrupted localization files from the official source."],"tags":["nopcommerce","install","localization","xml","language-pack","data-integrity"],"backgroundTag":null,"analyzedSha":"64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2","analyzedAt":"2026-08-13T21:19:38.062Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}