WorkflowRuntime.Dispose 方法

定義

釋放 所使用的 WorkflowRuntime資源。

public:
 virtual void Dispose();
public void Dispose();
abstract member Dispose : unit -> unit
override this.Dispose : unit -> unit
Public Sub Dispose ()

實作

備註

要優雅地關閉,WorkflowRuntime你應該只在打完電話Dispose後再撥打StopRuntime。 這是因為單純呼叫 Dispose 方法會讓 處於 WorkflowRuntime 無法使用的狀態。 Dispose 透過關閉未開啟的檔案帳柄、資料庫連線等,釋放執行時使用的資源,但不會卸載工作流程實例、停止服務,或執行其他相關 StopRuntime 操作。

Dispose 僅在主機應用程式必須釋放資源 WorkflowRuntime 後,垃圾回收器才會自動釋放資源時呼叫。 關於 的一般資訊 Dispose,請參見 「清理未管理資源實施處置方法」。

適用於