From 5beb0418d3ce3591e47e8847d15fa7269c90dc17 Mon Sep 17 00:00:00 2001 From: Shyju Krishnankutty Date: Thu, 12 Mar 2026 12:48:17 -0700 Subject: [PATCH] Add YieldsOutput(string) to workflow shared state sample executors ValidateOrder and EnrichOrder call YieldOutputAsync with string messages, but only their TOutput (OrderDetails) was in the allowed yield types. This caused TargetInvocationException in the WorkflowSharedState sample validation integration test. --- .../ConsoleApps/06_WorkflowSharedState/Executors.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dotnet/samples/04-hosting/DurableWorkflows/ConsoleApps/06_WorkflowSharedState/Executors.cs b/dotnet/samples/04-hosting/DurableWorkflows/ConsoleApps/06_WorkflowSharedState/Executors.cs index c0c8cfd097..57d2964c0c 100644 --- a/dotnet/samples/04-hosting/DurableWorkflows/ConsoleApps/06_WorkflowSharedState/Executors.cs +++ b/dotnet/samples/04-hosting/DurableWorkflows/ConsoleApps/06_WorkflowSharedState/Executors.cs @@ -31,6 +31,7 @@ internal sealed record AuditEntry(string Step, string Timestamp, string Detail); /// If the order ID starts with "INVALID", the executor halts the workflow early /// using . /// +[YieldsOutput(typeof(string))] internal sealed class ValidateOrder() : Executor("ValidateOrder") { public override async ValueTask HandleAsync( @@ -73,6 +74,7 @@ internal sealed class ValidateOrder() : Executor("Validate /// Uses ReadOrInitStateAsync to lazily initialize a shipping tier. /// Demonstrates custom scopes by writing shipping details under the "shipping" scope. /// +[YieldsOutput(typeof(string))] internal sealed class EnrichOrder() : Executor("EnrichOrder") { public override async ValueTask HandleAsync(