Share via


ComContractElement.RequiresSession 屬性

定義

取得或設定指定合約是否只能用在工作階段繫結上的布林值 (Boolean)。

public:
 property bool RequiresSession { bool get(); void set(bool value); };
[System.Configuration.ConfigurationProperty("requiresSession", DefaultValue=true)]
public bool RequiresSession { get; set; }
[<System.Configuration.ConfigurationProperty("requiresSession", DefaultValue=true)>]
member this.RequiresSession : bool with get, set
Public Property RequiresSession As Boolean

屬性值

如果合約只能用在工作階段繫結上,則為 true,否則為 false。 預設為 false

屬性

備註

當服務初始化時,整合執行階段會確保這個設定與要使用的繫結型別是一致的。 如果合約的一或多個繫結有衝突,便會產生例外狀況 (Exception)。 如果這個屬性是 false,此時正在使用單向通道,以及有存在任何 [out] 參數,也會產生例外狀況。

適用於