Provides a protection level and an exchange mechanism as part of the context of a binding element and the functionality to build the channel listeners and factories.
Assembly: System.WorkflowServices (in System.WorkflowServices.dll)
The allows the user to add an element to the binding of a service for managing its context exchange protocol. The is typically stacked on top of reliability, security, and transport binding elements. A does not require any configuration options and can create channel factories for IRequestChannel, IRequestSessionChannel, and IDuplexSessionChannel. It can also create channel listeners for IReplyChannel, IReplySessionChannel, and IDuplexSessionChannel. A context channel does not change the channel interface – the underlying channel stack must support the requested channel shape and session capability.
The channel listeners and factories are used to construct the part of the channel stacks used to process incoming and outgoing messages.
If a session-based binding is created with a and used with a contract that specifies SessionMode = NotAllowed, an InvalidOperationException is thrown when the channel is created with the following text: "Channel context management cannot be enabled or disabled after the channel is opened." You must set SessionMode to Allowed or Required or not use a session-based channel.
When creating a custom binding, it is recommended that you add the to the BindingElementCollection of the custom binding before adding any reliability and security binding elements, if present. If you do not, your service may throw a ProtocolException with the following message:
"Context channel received a message with context which does not match the current context cached at the channel. Ensure service does not change context after it was originally set or disable context management by setting channel property 'IContextManager.Enabled' to false."
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.