{"record":{"id":"79cf096d35a8cec7","repo":"abpframework/abp","slug":"cannot-determine-operating-system","errorCode":null,"errorMessage":"Cannot determine operating system!","messagePattern":"Cannot determine operating system!","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"critical","filePath":"framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/PlatformHelper.cs","lineNumber":26,"sourceCode":"    public static OSPlatform GetOperatingSystem()\n    {\n        if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))\n        {\n            //MAC\n            return OSPlatform.OSX;\n        }\n\n        if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))\n        {\n            return OSPlatform.Linux;\n        }\n\n        if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))\n        {\n            return OSPlatform.Windows;\n        }\n\n        throw new Exception(\"Cannot determine operating system!\");\n    }\n\n    public static RuntimePlatform GetPlatform()\n    {\n        if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) ||\n            RuntimeInformation.IsOSPlatform(OSPlatform.Linux))\n        {\n            return RuntimePlatform.LinuxOrMacOs;\n        }\n\n        if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))\n        {\n            return RuntimePlatform.Windows;\n        }\n\n        throw new Exception(\"Cannot determine runtime platform!\");\n    }\n}","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/abpframework/abp/blob/7ed43b1931b9df46a50c0c59148a18645641d0df/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/PlatformHelper.cs#L8-L44","documentation":"Thrown by PlatformHelper.GetOperatingSystem() when RuntimeInformation.IsOSPlatform returns false for OSX, Linux, and Windows. It returns the concrete OSPlatform but cannot classify the host. This is a generic System.Exception because the supported-OS list is exhaustive for ABP's CLI purposes.","triggerScenarios":"Running the CLI on an OS that .NET reports as none of OSX/Linux/Windows — e.g. FreeBSD, Solaris, or a platform where the runtime's OS detection is unavailable or returns a custom value.","commonSituations":"Exotic Unix variants not recognized by .NET's OSPlatform; very old or preview .NET runtimes with incomplete platform detection; running under a runtime shim that masks the real OS.","solutions":["Run the CLI on a supported OS (Windows, Linux, or macOS).","Upgrade the .NET runtime so RuntimeInformation correctly reports the platform.","If you must support another Unix, ensure .NET identifies it as Linux (some BSD setups can be coerced via runtime config)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"static bool IsSupportedOs() =>\n    RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ||\n    RuntimeInformation.IsOSPlatform(OSPlatform.Linux) ||\n    RuntimeInformation.IsOSPlatform(OSPlatform.OSX);\nif (!IsSupportedOs()) throw new PlatformNotSupportedException(RuntimeInformation.OSDescription);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run the ABP CLI on Windows, Linux, or macOS only.","Use a current .NET runtime so OS detection is accurate.","Document supported OSes for any tooling built on the CLI."],"tags":["abp-cli","platform","environment","unsupported-os"],"backgroundTag":null,"analyzedSha":"7ed43b1931b9df46a50c0c59148a18645641d0df","analyzedAt":"2026-08-13T16:26:11.351Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}