Kieli

ProcessStartInfo.KillOnParentExit Property

Definition

Gets or sets a value indicating whether the child process should be terminated when the parent process exits.

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

Property Value

true to terminate the child process when the parent exits; otherwise, false. The default is false.

Attributes

Remarks

When this property is set to true, the operating system automatically terminates the child process when the parent process exits, regardless of whether the parent exits gracefully or crashes.

This property cannot be used together with UseShellExecute set to true.

On Windows, the behavior is implemented using Job Objects with the JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE flag.

On Linux and Android, the behavior is implemented using prctl(PR_SET_PDEATHSIG).

Applies to