{"record":{"id":"57b277651307689f","repo":"Unity-Technologies/UnityCsReference","slug":"invalid-platform-manifest-at-0","errorCode":null,"errorMessage":"Invalid platform manifest at \\\"{0}\\\".","messagePattern":"Invalid platform manifest at \\\\\"(.+?)\\\\\"\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"Editor/Mono/Scripting/Compilers/UWPReferences.cs","lineNumber":299,"sourceCode":"                        return true;\n                    }\n                }\n            }\n\n            version = null;\n            return false;\n        }\n\n        private static string[] GetPlatform(string folder, string version)\n        {\n            var platformXml = CombinePaths(folder, @\"Platforms\\UAP\", version, \"Platform.xml\");\n            if (!File.Exists(platformXml))\n                return Array.Empty<string>();\n\n            var document = XDocument.Load(platformXml);\n            var applicationPlatformElement = document.Element(\"ApplicationPlatform\");\n            if (applicationPlatformElement.Attribute(\"name\").Value != \"UAP\")\n                throw new Exception(string.Format(\"Invalid platform manifest at \\\"{0}\\\".\", platformXml));\n            var containedApiContractsElement = applicationPlatformElement.Element(\"ContainedApiContracts\");\n            return GetReferences(folder, version, containedApiContractsElement);\n        }\n\n        private static string CombinePaths(params string[] paths)\n        {\n            return Path.Combine(paths);\n        }\n\n        private static IEnumerable<UWPExtensionSDK> GetExtensionSDKs(string sdkFolder, string sdkVersion)\n        {\n            var extensions = new List<UWPExtensionSDK>();\n            var extensionsFolder = Path.Combine(sdkFolder, \"Extension SDKs\");\n\n            if (!Directory.Exists(extensionsFolder))\n                return Array.Empty<UWPExtensionSDK>();\n\n            foreach (var extensionFolder in Directory.GetDirectories(extensionsFolder))","sourceCodeStart":281,"sourceCodeEnd":317,"githubUrl":"https://github.com/Unity-Technologies/UnityCsReference/blob/225b0fbdb57cc17d094e8056b71f8314aba56f73/Editor/Mono/Scripting/Compilers/UWPReferences.cs#L281-L317","documentation":"Thrown from GetPlatform when parsing Platforms/UAP/<version>/Platform.xml. The <ApplicationPlatform> element's name attribute must equal \"UAP\"; a mismatched platform manifest is rejected before API contract references are gathered.","triggerScenarios":"Calling GetPlatform with a folder/version whose Platform.xml has <ApplicationPlatform name=\"...\"> != \"UAP\", or where the file exists but describes a different platform, during UWP reference resolution.","commonSituations":"Wrong Windows SDK installation path, mismatched UAP version folder, corrupted or partial SDK install, or an environment where Platform.xml was replaced by a non-UAP file.","solutions":["Reinstall/repair the Windows SDK so Platforms/UAP/<version>/Platform.xml is a genuine UAP platform manifest.","Confirm the folder and version passed to GetPlatform correspond to an installed UAP SDK.","Open the Platform.xml path from the error and verify <ApplicationPlatform name=\"UAP\">."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"var doc = XDocument.Load(platformXml);\nvar platform = doc.Element(\"ApplicationPlatform\");\nif (platform?.Attribute(\"name\")?.Value != \"UAP\")\n    throw new InvalidOperationException($\"{platformXml} is not a UAP platform manifest.\");","typeGuard":null,"tryCatchPattern":"try\n{\n    var refs = GetPlatform(folder, version);\n}\ncatch (Exception ex) when (ex.Message.Contains(\"Invalid platform manifest\"))\n{\n    // Reinstall/repair the Windows SDK so Platform.xml is a genuine UAP manifest.\n}","preventionTips":["Keep a known-good Windows SDK install; repair it if Platform.xml is wrong.","Confirm the UAP version folder exists and contains a valid Platform.xml.","Avoid editing or replacing SDK manifest files."],"tags":["uwp","build","manifest","sdk","windows"],"backgroundTag":null,"analyzedSha":"225b0fbdb57cc17d094e8056b71f8314aba56f73","analyzedAt":"2026-08-13T19:07:19.849Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}