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,而佇列為非異動式。

-或-

ReceiveErrorHandling 設定為 Move,而 Windows Vista 中的佇列名稱包含 ";"。

-或-

ExactlyOnce 設定為 true,而且在 Windows Vista 中無法開啟重試子佇列。

-或-

ReceiveErrorHandling 設定為 Reject 或 Move,而且平台為 Windows Vista。

-或-

MsmqTransportSecurity.MsmqAuthenticationMode 已設為 WindowsDomain,且未使用 ActiveDirectory 整合安裝 MSMQ。

-或-

MsmqTransportSecurity.MsmqAuthenticationMode 為 None,而且 MsmqTransportSecurity.MsmqProtectionLevel 不是 None。

-或-

MsmqTransportSecurity.MsmqAuthenticationMode 為 Certificate,或者 WindowsDomain 和 MsmqTransportSecurity.MsmqProtectionLevel 為 None。

範例

transportBindingElement.BuildChannelListener<IInputChannel>(context);

適用於