{"record":{"id":"70f90fc36a14eaaa","repo":"dotnet/BenchmarkDotNet","slug":"unknown-net-runtime","errorCode":null,"errorMessage":"Unknown .NET Runtime","messagePattern":"Unknown \\.NET Runtime","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"critical","filePath":"src/BenchmarkDotNet/Portability/RuntimeInformation.cs","lineNumber":208,"sourceCode":"        internal static Runtime GetCurrentRuntime()\n        {\n            //do not change the order of conditions because it may cause incorrect determination of runtime\n            if (IsAot && IsMono)\n                return MonoAotLLVMRuntime.Default;\n            if (IsWasm)\n                return WasmRuntime.Default;\n            if (IsNewMono)\n                return MonoRuntime.GetCurrentVersion();\n            if (IsOldMono)\n                return MonoRuntime.Default;\n            if (IsFullFramework)\n                return ClrRuntime.GetCurrentVersion();\n            if (IsNetCore)\n                return CoreRuntime.GetCurrentVersion();\n            if (IsNativeAOT)\n                return NativeAotRuntime.GetCurrentVersion();\n\n            throw new NotSupportedException(\"Unknown .NET Runtime\");\n        }\n\n        public static Platform GetCurrentPlatform()\n        {\n            // these are not part of .NET Standard 2.0, so we use hardcoded values taken from\n            // https://github.com/dotnet/runtime/blob/080fcae7eaa8367abf7900e08ff2e52e3efea5bf/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Architecture.cs#L9\n            const Architecture Wasm = (Architecture)4;\n            const Architecture S390x = (Architecture)5;\n            const Architecture LoongArch64 = (Architecture)6;\n            const Architecture Armv6 = (Architecture)7;\n            const Architecture Ppc64le = (Architecture)8;\n            const Architecture RiscV64 = (Architecture)9;\n\n            switch (ProcessArchitecture)\n            {\n                case Architecture.Arm:\n                    return Platform.Arm;\n                case Architecture.Arm64:","sourceCodeStart":190,"sourceCodeEnd":226,"githubUrl":"https://github.com/dotnet/BenchmarkDotNet/blob/b515068b61ad1c9c9aa938b8ece4af1e7d6d85a3/src/BenchmarkDotNet/Portability/RuntimeInformation.cs#L190-L226","documentation":"Thrown by RuntimeInformation.GetCurrentRuntime() when none of the known runtime detectors match: IsWasm, IsNewMono, IsOldMono, IsFullFramework, IsNetCore, and IsNativeAOT all return false. This means BenchmarkDotNet cannot identify the executing .NET runtime and therefore cannot select appropriate host execution strategies, CoreRT/Mono/AOT runtimes, or framework characteristics.","triggerScenarios":"Running BenchmarkDotNet on an unsupported or unrecognized runtime environment, such as a preview/new runtime flavor whose detection heuristics (registry keys, environment variables, type presence checks) are not yet implemented, or on a stripped/self-contained runtime where the detection markers are absent.","commonSituations":"Using a very new .NET preview or a non-standard runtime (e.g., a custom NativeAOT variant, WASM without the expected detector, or an exotic platform). Also on runtimes where BenchmarkDotNet's version predates the runtime's release.","solutions":["Upgrade BenchmarkDotNet to a version that supports the target runtime.","If running on a known runtime that is misdetected, check environment variables and runtime information the detectors rely on.","For unsupported runtimes, consider explicitly specifying the runtime in the Job configuration rather than relying on auto-detection.","Report the issue to BenchmarkDotNet with details of the runtime and OS for a detector update."],"exampleFix":"// before (auto-detection fails)\nvar config = ManualConfig.Create(DefaultConfig.Instance);\n\n// after (explicitly specify runtime)\nvar config = ManualConfig.Create(DefaultConfig.Instance)\n    .AddJob(Job.Default.WithRuntime(CoreRuntime.Core80));","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try\n{\n    var runtime = RuntimeInformation.GetCurrentRuntime();\n}\ncatch (NotSupportedException)\n{\n    // Fallback: explicitly specify the runtime in the Job config\n    var job = Job.Default.WithRuntime(CoreRuntime.Core80);\n}","preventionTips":["Keep BenchmarkDotNet updated to the latest version that supports your runtime.","When targeting a new/preview runtime, explicitly configure the runtime in the Job rather than relying on auto-detection.","Test benchmark suites on the target runtime in CI before relying on them."],"tags":["runtime-detection","not-supported","environment","startup"],"backgroundTag":null,"analyzedSha":"b515068b61ad1c9c9aa938b8ece4af1e7d6d85a3","analyzedAt":"2026-08-13T19:12:24.196Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}