{"record":{"id":"a6b45f57360b19bc","repo":"Unity-Technologies/UnityCsReference","slug":"unsupported-os-platform-runtimeinformation-osdesc","errorCode":null,"errorMessage":"Unsupported OS platform {RuntimeInformation.OSDescription}","messagePattern":"Unsupported OS platform (.+?)","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"critical","filePath":"Editor/Mono/Scripting/ScriptCompilation/MsBuild/UnityEditorMSBuildPropsTargetsGeneration.cs","lineNumber":220,"sourceCode":"        }\n        else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))\n        {\n            return \"linux-x64\";\n        }\n        else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))\n        {\n            switch (RuntimeInformation.ProcessArchitecture)\n            {\n                case Architecture.Arm64:\n                    return \"osx-arm64\";\n                case Architecture.X64:\n                    return \"osx-x64\";\n                default:\n                    throw new NotSupportedException($\"Unsupported architecture {RuntimeInformation.ProcessArchitecture} on macOS\");\n            }\n        }\n\n        throw new NotSupportedException($\"Unsupported OS platform {RuntimeInformation.OSDescription}\");\n    }\n\n    private static string s_cachedUnitySdkVersion;\n\n    // Reads the version from Unity.Sdk.<version>.nupkg so global.json tracks CI's bumped value\n    // (in sdk/UnitySdksCommon.props) instead of a hardcoded literal.\n    private static string GetUnitySdkVersion(string sdkNugetsPath)\n    {\n        if (s_cachedUnitySdkVersion != null)\n            return s_cachedUnitySdkVersion;\n\n        const string prefix = \"Unity.Sdk.\";\n        const string suffix = \".nupkg\";\n\n        if (!Directory.Exists(sdkNugetsPath))\n            throw new DirectoryNotFoundException($\"Unity SDK nuget feed not found at {sdkNugetsPath}\");\n\n        foreach (var file in Directory.EnumerateFiles(sdkNugetsPath, $\"{prefix}*{suffix}\"))","sourceCodeStart":202,"sourceCodeEnd":238,"githubUrl":"https://github.com/Unity-Technologies/UnityCsReference/blob/225b0fbdb57cc17d094e8056b71f8314aba56f73/Editor/Mono/Scripting/ScriptCompilation/MsBuild/UnityEditorMSBuildPropsTargetsGeneration.cs#L202-L238","documentation":"Thrown by GetCurrentDotNETRuntimeId (UnityEditorMSBuildPropsTargetsGeneration.cs:220, NotSupportedException) when the host OS is reported as neither Windows, Linux, nor macOS (RuntimeInformation.IsOSPlatform returns false for all three). This is the fallthrough after the Windows/macOS branches and indicates an entirely unsupported operating system for Unity's bundled .NET toolchain.","triggerScenarios":"Running the editor on an OS such as FreeBSD, a non-standard Linux distribution misreported by the runtime, or an unsupported Unix.","commonSituations":"Unsupported OS, broken OS detection, or an exotic container/VM where RuntimeInformation.OSDescription does not match a supported platform.","solutions":["Run Unity Editor on a supported operating system (Windows, macOS, or a supported Linux distribution).","If the OS is actually supported but misreported, ensure the .NET runtime is the one Unity ships rather than a system runtime that mis-detects the platform."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"bool supported = RuntimeInformation.IsOSPlatform(OSPlatform.Windows)\n               || RuntimeInformation.IsOSPlatform(OSPlatform.Linux)\n               || RuntimeInformation.IsOSPlatform(OSPlatform.OSX);\nif (!supported)\n    throw new PlatformNotSupportedException(\n        $\"Unity Editor requires Windows, macOS, or Linux (got {RuntimeInformation.OSDescription}).\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run Unity Editor only on Windows, macOS, or a supported Linux distribution.","Use the runtime Unity ships, not a system runtime that may mis-detect the platform.","Add an OS precheck at editor launch."],"tags":["unity","msbuild","dotnet","os","environment","unsupported"],"backgroundTag":null,"analyzedSha":"225b0fbdb57cc17d094e8056b71f8314aba56f73","analyzedAt":"2026-08-13T19:07:19.849Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}