diff --git a/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/AsyncValueTaskMethodBuilder.cs b/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/AsyncValueTaskMethodBuilder.cs index 786a25ccbe3..715ede184f4 100644 --- a/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/AsyncValueTaskMethodBuilder.cs +++ b/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/AsyncValueTaskMethodBuilder.cs @@ -40,8 +40,11 @@ public static AsyncValueTaskMethodBuilder Create() => /// The state machine instance, passed by reference. [MethodImpl(MethodImplOptions.AggressiveInlining)] public void Start(ref TStateMachine stateMachine) where TStateMachine : IAsyncStateMachine => +#if netstandard + _methodBuilder.Start(ref stateMachine); +#else AsyncMethodBuilderCore.Start(ref stateMachine); // will provide the right ExecutionContext semantics - +#endif /// Associates the builder with the specified state machine. /// The state machine instance to associate with the builder. public void SetStateMachine(IAsyncStateMachine stateMachine) => _methodBuilder.SetStateMachine(stateMachine);