{"record":{"id":"5a38c6ece1127bf8","repo":"dotnet/BenchmarkDotNet","slug":"runtime-moniker-not-supported","errorCode":null,"errorMessage":"Runtime Moniker not supported","messagePattern":"Runtime Moniker not supported","errorType":"exception","errorClass":"ArgumentOutOfRangeException","httpStatus":null,"severity":"error","filePath":"src/BenchmarkDotNet/Extensions/RuntimeMonikerExtensions.cs","lineNumber":83,"sourceCode":"                    return MonoRuntime.Mono70;\n                case RuntimeMoniker.Mono80:\n                    return MonoRuntime.Mono80;\n                case RuntimeMoniker.Mono90:\n                    return MonoRuntime.Mono90;\n                case RuntimeMoniker.Mono10_0:\n                    return MonoRuntime.Mono10_0;\n                case RuntimeMoniker.Mono11_0:\n                    return MonoRuntime.Mono11_0;\n                case RuntimeMoniker.R2R80:\n                    return R2RRuntime.Net80;\n                case RuntimeMoniker.R2R90:\n                    return R2RRuntime.Net90;\n                case RuntimeMoniker.R2R10_0:\n                    return R2RRuntime.Net10_0;\n                case RuntimeMoniker.R2R11_0:\n                    return R2RRuntime.Net11_0;\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(runtimeMoniker), runtimeMoniker, \"Runtime Moniker not supported\");\n            }\n        }\n\n        internal static Version GetRuntimeVersion(this RuntimeMoniker runtimeMoniker) => runtimeMoniker switch\n        {\n            RuntimeMoniker.Net461 => new Version(4, 6, 1),\n            RuntimeMoniker.Net462 => new Version(4, 6, 2),\n            RuntimeMoniker.Net47 => new Version(4, 7),\n            RuntimeMoniker.Net471 => new Version(4, 7, 1),\n            RuntimeMoniker.Net472 => new Version(4, 7, 2),\n            RuntimeMoniker.Net48 => new Version(4, 8),\n            RuntimeMoniker.Net481 => new Version(4, 8, 1),\n            RuntimeMoniker.NetCoreApp20 => new Version(2, 0),\n            RuntimeMoniker.NetCoreApp21 => new Version(2, 1),\n            RuntimeMoniker.NetCoreApp22 => new Version(2, 2),\n            RuntimeMoniker.NetCoreApp30 => new Version(3, 0),\n            RuntimeMoniker.NetCoreApp31 => new Version(3, 1),\n            RuntimeMoniker.Net50 => new Version(5, 0),","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/dotnet/BenchmarkDotNet/blob/b515068b61ad1c9c9aa938b8ece4af1e7d6d85a3/src/BenchmarkDotNet/Extensions/RuntimeMonikerExtensions.cs#L65-L101","documentation":"RuntimeMonikerExtensions.GetRuntime maps each RuntimeMoniker enum value to a runtime instance via a switch; the default arm throws ArgumentOutOfRangeException (\"Runtime Moniker not supported\"). This fires when a moniker value has no mapping, typically a newly added enum member the loaded library version does not recognize.","triggerScenarios":"Passing a RuntimeMoniker value not covered by the GetRuntime switch (e.g. a moniker introduced in a newer BenchmarkDotNet release while an older version is loaded, or a future/undefined enum value).","commonSituations":"Version mismatch between the RuntimeMoniker enum the code was compiled against and the installed BenchmarkDotNet, using a preview moniker in a stable build, or casting an invalid integer to RuntimeMoniker.","solutions":["Upgrade BenchmarkDotNet to a version that supports the RuntimeMoniker you are using.","Use a moniker known to be supported by your installed version (e.g. Net90 instead of a newer one).","Verify the enum value is within the supported set before configuring the job."],"exampleFix":"// before (on an older BenchmarkDotNet build)\njob = Job.Default.WithRuntime(CoreRuntime.Net100); // moniker unsupported\n\n// after\njob = Job.Default.WithRuntime(CoreRuntime.Net90);","handlingStrategy":"validation","validationCode":"if (!Enum.IsDefined(typeof(RuntimeMoniker), moniker)) throw new ArgumentOutOfRangeException(nameof(moniker));\n// and pin a BenchmarkDotNet version that maps the moniker you use","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep BenchmarkDotNet version aligned with the newest runtime you target.","Prefer WithRuntime(CoreRuntime.NetXX) over raw RuntimeMoniker where possible.","Check release notes for newly added monikers before adopting them."],"tags":["runtime-moniker","version","config","argument"],"backgroundTag":null,"analyzedSha":"b515068b61ad1c9c9aa938b8ece4af1e7d6d85a3","analyzedAt":"2026-08-13T19:12:24.196Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}