dotnet/BenchmarkDotNet · error · ArgumentOutOfRangeException
Runtime moniker {runtimeMoniker} is not supported
Error message
Runtime moniker {runtimeMoniker} is not supported What it means
DotTraceDiagnoser.IsSupported is an exhaustive switch over RuntimeMoniker that throws ArgumentOutOfRangeException on the default branch. Reached only for a moniker value this BDN build does not enumerate at all.
Source
Thrown at src/BenchmarkDotNet.Diagnostics.dotTrace/DotTraceDiagnoser.cs:130
case RuntimeMoniker.MonoAOTLLVMNet90:
case RuntimeMoniker.MonoAOTLLVMNet10_0:
case RuntimeMoniker.MonoAOTLLVMNet11_0:
case RuntimeMoniker.Mono60:
case RuntimeMoniker.Mono70:
case RuntimeMoniker.Mono80:
case RuntimeMoniker.Mono90:
case RuntimeMoniker.Mono10_0:
case RuntimeMoniker.Mono11_0:
return false;
case RuntimeMoniker.NetCoreApp20:
case RuntimeMoniker.NetCoreApp21:
case RuntimeMoniker.NetCoreApp22:
return OsDetector.IsWindows();
case RuntimeMoniker.NetCoreApp30:
case RuntimeMoniker.NetCoreApp31:
return OsDetector.IsWindows() || OsDetector.IsLinux();
default:
throw new ArgumentOutOfRangeException(nameof(runtimeMoniker), runtimeMoniker, $"Runtime moniker {runtimeMoniker} is not supported");
}
}
}
View on GitHub (pinned to b515068b61)
Solutions
- Upgrade BenchmarkDotNet.Diagnostics.dotTrace to a version whose IsSupported switch covers your moniker.
- If patching, add the missing case returning the desired bool.
- Switch the Job to a supported runtime moniker.
Defensive patterns
Strategy: validation
Validate before calling
static readonly HashSet<RuntimeMoniker> DotTraceSupported = new()
{ RuntimeMoniker.Net80, RuntimeMoniker.Net90, RuntimeMoniker.Net60 /* ...per IsSupported */ };
if (!DotTraceSupported.Contains(job.Runtime.Moniker))
throw new NotSupportedException($"dotTrace diagnoser does not support {job.Runtime.Moniker}; upgrade BDN."); Prevention
- Use a BenchmarkDotNet.Diagnostics.dotTrace build whose IsSupported covers your moniker.
- Avoid preview SDKs mapping to monikers not yet enumerated.
- Add the missing case in IsSupported when patching BDN.
When it happens
Trigger: A new .NET release introduces a RuntimeMoniker not yet covered by this DotTraceDiagnoser build, or a custom/derived moniker is supplied. Every currently-known moniker returns an explicit true/false.
Common situations: Running on a preview/newer SDK whose moniker postdates this diagnoser build; mismatched BDN engine + diagnoser versions where the engine knows a newer moniker.
Related errors
- Runtime moniker {runtimeMoniker} is not supported
- Field 'ConsoleRunnerPackage' not found.
- Unable to get value of 'ConsoleRunnerPackage'.
- Method 'GetRunnerPath' not found.
- Unable to invoke 'GetRunnerPath'.
AI-assisted analysis of dotnet/BenchmarkDotNet@b515068b61 (2026-08-13).
Data as JSON: /api/errors/171ce5d63c5606f6.
Report an issue: GitHub.