Share via


MsmqTransportBindingElement.BuildChannelListener<TChannel> 方法

定义

使用提供的上下文生成通道侦听器。

public:
generic <typename TChannel>
 where TChannel : class, System::ServiceModel::Channels::IChannel override System::ServiceModel::Channels::IChannelListener<TChannel> ^ BuildChannelListener(System::ServiceModel::Channels::BindingContext ^ context);
public override System.ServiceModel.Channels.IChannelListener<TChannel> BuildChannelListener<TChannel> (System.ServiceModel.Channels.BindingContext context) where TChannel : class, System.ServiceModel.Channels.IChannel;
override this.BuildChannelListener : System.ServiceModel.Channels.BindingContext -> System.ServiceModel.Channels.IChannelListener<'Channel (requires 'Channel : null and 'Channel :> System.ServiceModel.Channels.IChannel)> (requires 'Channel : null and 'Channel :> System.ServiceModel.Channels.IChannel)
Public Overrides Function BuildChannelListener(Of TChannel As {Class, IChannel}) (context As BindingContext) As IChannelListener(Of TChannel)

类型参数

TChannel

用于生成通道侦听器的通道类型。 允许使用的通道类型为 IInputSessionChannelIInputChannel 类。

参数

context
BindingContext

用以生成通道侦听器的 BindingContext

返回

一个消息队列 (MSMQ) 通道侦听器,用于创建可从现有 MSMQ 应用程序接收消息的通道。

例外

上下文值为 null。

TChannel 不为 IInputChannel 或 IInputSessionChannel。

ExactlyOnce 为 true,而 Durable 为 false。

- 或 -

不可读队列。

- 或 -

ExactlyOnce 为 true,而队列是非事务性的。

- 或 -

ExactlyOnce 为 false,而队列是事务性的。

- 或 -

在 Windows Vista 中,ReceiveErrorHandling 设置为 Move,而队列名称中包含一个“;”。

- 或 -

在 Windows Vista 中,ExactlyOnce 设置为 true,但是不能打开重试子队列。

- 或 -

ReceiveErrorHandling 设置为 Reject 或 Move,而平台是 Windows Vista。

- 或 -

MsmqTransportSecurity.MsmqAuthenticationMode 设置为 WindowsDomain,而 MSMQ 是在没有 ActiveDirectory 集成的情况下安装的。

- 或 -

MsmqTransportSecurity.MsmqAuthenticationMode 为 None,而 MsmqTransportSecurity.MsmqProtectionLevel 不为 None。

- 或 -

MsmqTransportSecurity.MsmqAuthenticationMode 为 Certificate 或 WindowsDomain,而 MsmqTransportSecurity.MsmqProtectionLevel 为 None。

示例

transportBindingElement.BuildChannelListener<IInputChannel>(context);

适用于