Language

ProcessStartInfo.KillOnParentExit プロパティ

定義

親プロセスが終了したときに子プロセスを終了するかどうかを示す値を取得または設定します。

public:
 property bool KillOnParentExit { bool get(); void set(bool value); };
[System.Runtime.Versioning.SupportedOSPlatform("android")]
[System.Runtime.Versioning.SupportedOSPlatform("linux")]
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public bool KillOnParentExit { get; set; }
[<System.Runtime.Versioning.SupportedOSPlatform("android")>]
[<System.Runtime.Versioning.SupportedOSPlatform("linux")>]
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
member this.KillOnParentExit : bool with get, set
Public Property KillOnParentExit As Boolean

プロパティ値

true 親が終了したときに子プロセスを終了する場合。それ以外の場合は false。 既定値は false です。

属性

注釈

このプロパティを true に設定すると、親が正常に終了するかクラッシュしたかに関係なく、親プロセスが終了すると、オペレーティング システムは自動的に子プロセスを終了します。

このプロパティは、trueに設定UseShellExecuteと共に使用することはできません。

Windowsでは、動作はジョブ オブジェクトと JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE フラグを使用して実装されます。

Linux および Android では、動作は prctl(PR_SET_PDEATHSIG) を使用して実装されます。

適用対象