共用方式為


ServiceInstaller.ServicesDependedOn 屬性

定義

表示要執行這個服務而必須執行的服務。

public:
 property cli::array <System::String ^> ^ ServicesDependedOn { cli::array <System::String ^> ^ get(); void set(cli::array <System::String ^> ^ value); };
public string[] ServicesDependedOn { get; set; }
[System.ServiceProcess.ServiceProcessDescription("ServiceInstallerServicesDependedOn")]
public string[] ServicesDependedOn { get; set; }
member this.ServicesDependedOn : string[] with get, set
[<System.ServiceProcess.ServiceProcessDescription("ServiceInstallerServicesDependedOn")>]
member this.ServicesDependedOn : string[] with get, set
Public Property ServicesDependedOn As String()

屬性值

String[]

服務的陣列必須在與這個安裝程式相關的服務執行前執行。

屬性

備註

服務可以在啟動之前要求其他服務正在執行。 這個屬性的資訊會寫入登錄中的機碼。 當使用者 (或系統的情況下,如果自動啟動) 嘗試執行服務,服務控制管理員 (SCM) 確認陣列中的每個服務都已啟動。

如果陣列中的任何服務未執行,則 SCM 會嘗試啟動它們。 這包括的服務 Manual StartType

如果此服務相依的任何服務無法啟動,則不會啟動此服務。 如果系統未啟動,就不會擲回例外狀況,因為系統層級沒有例外狀況處理可偵測此狀況。 決定如何處理服務啟動失敗,並在您的程式碼中執行。 一般而言,如果服務無法啟動,就會在啟動時向使用者顯示對話方塊。

如果服務未啟動,則會將專案寫入應用程式事件記錄檔。

這項服務所依賴的服務不需要位於相同的可執行檔中。

適用於

另請參閱