Duplex contract captures synchronization context
DuplexChannelFactory<TChannel> now captures the synchronization context when it's opened, and it dispatches callbacks to the captured context.
Previous behavior
In previous versions, DuplexChannelFactory<TChannel> failed to capture the current synchronization context when the channel factory was opened.
New behavior
Starting in WCF Client 6.0 RC, DuplexChannelFactory<TChannel> captures the current synchronization context when opened and dispatches callbacks to the captured context. This behavior matches that of .NET Framework.
Version introduced
WCF Client 6.0 RC
Type of breaking change
This change is a behavioral change.
Reason for change
This change was made to fix a bug where callbacks were happening on the wrong thread. The new behavior matches .NET Framework functionality.
Recommended action
If the new behavior is undesirable, you can revert to version 4.x behavior by applying the CallbackBehaviorAttribute to your callback contract with the UseSynchronizationContext property set to false
.
Affected APIs
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for