ChannelDispatcher.Attach(ServiceHostBase) 方法

定義

將通道發送器附加至主機。Attaches the channel dispatcher to the host.

protected:
 override void Attach(System::ServiceModel::ServiceHostBase ^ host);
protected override void Attach (System.ServiceModel.ServiceHostBase host);
override this.Attach : System.ServiceModel.ServiceHostBase -> unit
Protected Overrides Sub Attach (host As ServiceHostBase)

參數

host
ServiceHostBase

服務的 ServiceHostBaseThe ServiceHostBase for the service.

例外狀況

通訊物件處於 OpeningOpened 狀態中。The communication object is in an Opening or Opened state.

通訊物件處於 ClosingClosed 狀態中。The communication object is in a Closing or Closed state.

通訊物件處於 Faulted 狀態中。The communication object is in a Faulted state.

備註

只有在 ChannelDispatcher 的執行個體處於 Created 狀態時才可以設定這個屬性,因為這是唯一同時處於可變動且尚未處置的狀態。This property can only be set when the instance of the ChannelDispatcher is in the Created state, as this is the only state that is both mutable and not disposed.

適用於