diff --git a/dotnet/src/Experimental/Process.LocalRuntime/LocalStep.cs b/dotnet/src/Experimental/Process.LocalRuntime/LocalStep.cs index 3d6ee8b21cf7..abc4659125d8 100644 --- a/dotnet/src/Experimental/Process.LocalRuntime/LocalStep.cs +++ b/dotnet/src/Experimental/Process.LocalRuntime/LocalStep.cs @@ -255,6 +255,7 @@ protected virtual async ValueTask InitializeStepAsync() } stateObject = (KernelProcessStepState?)Activator.CreateInstance(stateType, this.Name, this.Id); + stateType.GetProperty(nameof(KernelProcessStepState.State))?.SetValue(stateObject, Activator.CreateInstance(userStateType)); } else { diff --git a/dotnet/src/IntegrationTests/Processes/ProcessTests.cs b/dotnet/src/IntegrationTests/Processes/ProcessTests.cs index cd98a9321ad0..5d7800490827 100644 --- a/dotnet/src/IntegrationTests/Processes/ProcessTests.cs +++ b/dotnet/src/IntegrationTests/Processes/ProcessTests.cs @@ -329,7 +329,7 @@ await context.EmitEventAsync(new() /// private sealed class FanInStep : KernelProcessStep { - private StepState? _state = new(); + private StepState? _state; public override ValueTask ActivateAsync(KernelProcessStepState state) {