WaitForExitTask Class

Summary

Waits for a given process on the local computer to exit.
Assembly
NAnt.Contrib.dll
Namespace
NAnt.Contrib.Tasks
Base Types
  • Task
graph BT Type-->Base0["Task"] Type["WaitForExitTask"] class Type type-node

Syntax

[TaskName("waitforexit")]
public class WaitForExitTask : Task

Examples

Starts two batch processes, and waits for them to finish.

    <exec program="batch1.exe" pidproperty="batch1.pid" spawn="true" />
<exec program="batch2.exe" pidproperty="batch2.pid" spawn="true" />
<waitforexit pid="${batch1.pid}" />
<waitforexit pid="${batch2.pid}" />

Remarks

When used in combination with the ExecTask, it allows processed to be spawned for a certain duration or task, and then wait until the process is finished before continueing.

When the process identified by NAnt.Contrib.Tasks.WaitForExitTask.ProcessId is no longer running, then the outcome is considered successful.

Attributes

Type Description
TaskName

Properties

Name Value Summary
ProcessId int
The unique identifier of the process to wait for.
TimeOut int
The maximum amount of time to wait until the process is exited, expressed in milliseconds. The default is to wait indefinitely.

Methods

Name Value Summary
ExecuteTask() void