dotnet/BenchmarkDotNet · error · NotSupportedException

Runtime = " + runtime

Error message

Runtime = " + runtime

What it means

Executor builds the ProcessStartInfo per runtime type; an unrecognized runtime falls into the default branch and throws NotSupportedException reporting the runtime value.

Source

Thrown at src/BenchmarkDotNet/Toolchains/Executor.cs:156

                case R2RRuntime _:
                    start.FileName = exePath;
                    start.Arguments = args;
                    break;
                case MonoRuntime mono:
                    start.FileName = mono.CustomPath.IsNotBlank() ? mono.CustomPath : "mono";
                    start.Arguments = GetMonoArguments(benchmarkCase.Job, exePath, args, resolver);
                    break;
                case MonoAotLLVMRuntime _:
                    start.FileName = exePath;
                    start.Arguments = args;
                    start.WorkingDirectory = Path.Combine(artifactsPaths.BinariesDirectoryPath, "publish");
                    break;
                case CustomRuntime _:
                    start.FileName = exePath;
                    start.Arguments = args;
                    break;
                default:
                    throw new NotSupportedException("Runtime = " + runtime);
            }
            return start;
        }

        private static string GetMonoArguments(Job job, string exePath, string args, IResolver resolver)
        {
            var arguments = job.HasValue(InfrastructureMode.ArgumentsCharacteristic)
                ? job.ResolveValue(InfrastructureMode.ArgumentsCharacteristic, resolver)!.OfType<MonoArgument>().ToArray()
                : [];

            // from mono --help: "Usage is: mono [options] program [program-options]"
            var builder = new StringBuilder(30);

            builder.Append(job.ResolveValue(EnvironmentMode.JitCharacteristic, resolver) == Jit.Llvm ? "--llvm" : "--nollvm");

            foreach (var argument in arguments)
            {
                builder.Append($" {argument.TextRepresentation}");

View on GitHub (pinned to b515068b61)

Solutions

  1. Use one of the supported runtime types: CoreRuntime, ClrRuntime, MonoRuntime, MonoAotLLVMRuntime, or CustomRuntime.
  2. If you introduced a custom Runtime subclass, extend Executor to handle it instead of falling through to the default case.
  3. Upgrade BenchmarkDotNet if the runtime you target was added in a later release.

When it happens

Trigger: Thrown at src/BenchmarkDotNet/Toolchains/Executor.cs:156 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of dotnet/BenchmarkDotNet@b515068b61 (2026-08-13). Data as JSON: /api/errors/c35da15141493ab4. Report an issue: GitHub.