{"record":{"id":"9124873ebfbd6498","repo":"Unity-Technologies/UnityCsReference","slug":"unknown-desktopplugincpuarchitecture-value-archi","errorCode":null,"errorMessage":"Unknown DesktopPluginCPUArchitecture value: {architecture}","messagePattern":"Unknown DesktopPluginCPUArchitecture value: (.+?)","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"Editor/Mono/ImportSettings/DesktopPluginImporterExtension.cs","lineNumber":374,"sourceCode":"            switch (architecture)\n            {\n                case DesktopPluginCPUArchitecture.None :\n                    return \"None\";\n\n                case DesktopPluginCPUArchitecture.x86 :\n                    return buildTarget == BuildTarget.StandaloneOSX ? \"Intel 32-bit\" : \"x86\";\n\n                case DesktopPluginCPUArchitecture.x86_64:\n                    return buildTarget == BuildTarget.StandaloneOSX ? \"Intel 64-bit\" : \"x64\";\n\n                case DesktopPluginCPUArchitecture.ARM64:\n                    return buildTarget == BuildTarget.StandaloneOSX ? \"Apple silicon\" : \"ARM64\";\n\n                case DesktopPluginCPUArchitecture.AnyCPU:\n                    return \"Any CPU\";\n\n                default:\n                    throw new NotSupportedException(\"Unknown DesktopPluginCPUArchitecture value: \" + architecture);\n            }\n        }\n    }\n}\n","sourceCodeStart":356,"sourceCodeEnd":379,"githubUrl":"https://github.com/Unity-Technologies/UnityCsReference/blob/225b0fbdb57cc17d094e8056b71f8314aba56f73/Editor/Mono/ImportSettings/DesktopPluginImporterExtension.cs#L356-L379","documentation":"GetCPUString switches over DesktopPluginCPUArchitecture and the default arm throws NotSupportedException for an unhandled enum value. This is a defensive exhaustive-switch guard: every defined architecture (None, x86, x86_64, ARM64, AnyCPU) has a case, so reaching default implies an enum value the editor build does not know about.","triggerScenarios":"A DesktopPluginCPUArchitecture value not covered by any case reaches the switch — typically a value from a newer/different Unity version or a deserialized/corrupted enum value that is numerically outside the known set.","commonSituations":"Loading a project or plugin asset whose serialized CPU architecture enum was written by a newer Unity version that added a member (e.g. a new ARM variant). Manually editing serialized plugin data. Version skew between the editor and an asset imported elsewhere.","solutions":["Re-open the project in the Unity version that wrote the plugin asset, or upgrade the editor to the version that introduced the new enum member.","Reset the plugin's CPU architecture in the inspector to a known value (AnyCPU/x86_64) and re-save.","Reimport the plugin to re-derive a valid architecture from its binary metadata.","If authoring a fork, add a case for the new enum value in GetCPUString."],"exampleFix":"// before: serialized enum value unknown to this editor -> default throws\n\n// after: reset to a known architecture via inspector or\nimp.SetPlatformData(platformName, cpuKey, nameof(DesktopPluginCPUArchitecture.x86_64));","handlingStrategy":"type-guard","validationCode":"if (!Enum.IsDefined(typeof(DesktopPluginCPUArchitecture), architecture))\n    architecture = DesktopPluginCPUArchitecture.AnyCPU; // or reject","typeGuard":"static bool IsKnown(DesktopPluginCPUArchitecture a) =>\n    a == DesktopPluginCPUArchitecture.None || a == DesktopPluginCPUArchitecture.x86 ||\n    a == DesktopPluginCPUArchitecture.x86_64 || a == DesktopPluginCPUArchitecture.ARM64 ||\n    a == DesktopPluginCPUArchitecture.AnyCPU;","tryCatchPattern":null,"preventionTips":["Reimport plugins serialized by a different Unity version rather than editing enum data by hand.","When extending the enum in a fork, update every switch (GetCPUString and siblings) atomically.","Validate enum values with Enum.IsDefined before passing to CPU-string resolvers."],"tags":["plugin-importer","enum","cpu-architecture","desktop","version-skew"],"backgroundTag":null,"analyzedSha":"225b0fbdb57cc17d094e8056b71f8314aba56f73","analyzedAt":"2026-08-13T19:07:19.849Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}