{"record":{"id":"5dc4287e30b28d58","repo":"dotnet/BenchmarkDotNet","slug":"default-benchmarkactionfactory-does-not-support-re","errorCode":null,"errorMessage":"Default BenchmarkActionFactory does not support returning awaitable types except (Value)Task(<T>).","messagePattern":"Default BenchmarkActionFactory does not support returning awaitable types except \\(Value\\)Task\\(<T>\\)\\.","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"src/BenchmarkDotNet/Toolchains/InProcess/NoEmit/BenchmarkActionFactory.cs","lineNumber":78,"sourceCode":"                        ? typeof(BenchmarkActionBlockingTask<>).MakeGenericType(argType)\n                        : typeof(BenchmarkActionTask<>).MakeGenericType(argType),\n                    resultInstance,\n                    targetMethod,\n                    unrollFactor);\n\n            if (typeof(ValueTask<>) == genericType)\n                return Create(\n                    consumeTasksSynchronously\n                        ? typeof(BenchmarkActionBlockingValueTask<>).MakeGenericType(argType)\n                        : typeof(BenchmarkActionValueTask<>).MakeGenericType(argType),\n                    resultInstance,\n                    targetMethod,\n                    unrollFactor);\n        }\n\n        if (resultType.IsAwaitable(out _))\n        {\n            throw new NotSupportedException($\"Default {nameof(BenchmarkActionFactory)} does not support returning awaitable types except (Value)Task(<T>).\");\n        }\n\n        if (resultType.IsAsyncEnumerable(out var asyncEnumerableInfo))\n        {\n            var asyncEnumerableInterface = typeof(IAsyncEnumerable<>).MakeGenericType(asyncEnumerableInfo.ItemType);\n            if (asyncEnumerableInterface.IsAssignableFrom(resultType))\n            {\n                return Create(\n                    typeof(BenchmarkActionAsyncEnumerable<>).MakeGenericType(asyncEnumerableInfo.ItemType),\n                    resultInstance,\n                    targetMethod,\n                    unrollFactor);\n            }\n            if (resultType.IsGenericType && resultType.GetGenericTypeDefinition() == typeof(ConfiguredCancelableAsyncEnumerable<>))\n            {\n                return Create(\n                    typeof(BenchmarkActionConfiguredCancelableAsyncEnumerable<>).MakeGenericType(asyncEnumerableInfo.ItemType),\n                    resultInstance,","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/dotnet/BenchmarkDotNet/blob/b515068b61ad1c9c9aa938b8ece4af1e7d6d85a3/src/BenchmarkDotNet/Toolchains/InProcess/NoEmit/BenchmarkActionFactory.cs#L60-L96","documentation":"The default InProcess NoEmit BenchmarkActionFactory only knows how to await (Value)Task(<T>); benchmarks returning other awaitable types throw NotSupportedException.","triggerScenarios":"Thrown at src/BenchmarkDotNet/Toolchains/InProcess/NoEmit/BenchmarkActionFactory.cs:78 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Return Task, Task<T>, ValueTask, or ValueTask<T> from the async benchmark method.","For other awaitable types, run the benchmark with the default out-of-process toolchain or provide a custom BenchmarkActionFactory."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b515068b61ad1c9c9aa938b8ece4af1e7d6d85a3","analyzedAt":"2026-08-13T19:12:24.196Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}