NAnt SDK Documentation - v0.92

FailTask Class

Exits the current build by throwing a BuildException, optionally printing additional information.

For a list of all members of this type, see FailTask Members.

System.Object
   NAnt.Core.Element
      NAnt.Core.Task
         NAnt.Core.Tasks.FailTask

[Visual Basic]
<TaskName(Name:="fail")>
Public Class FailTask
    Inherits Task
[C#]
[TaskName(Name="fail")]
public class FailTask : Task

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

The cause of the build failure can be specified using the Message attribute or as inline content.

Macros in the message will be expanded.

Example

Exits the current build without giving further information.

    
<fail />
    
  

Exits the current build and writes a message to the build log.

    
<fail message="Something wrong here." />
    
  

Functionally equivalent to the previous example.

    
<fail>Something wrong here.</fail>
    
  

Requirements

Namespace: NAnt.Core.Tasks

Assembly: NAnt.Core (in NAnt.Core.dll)

See Also

FailTask Members | NAnt.Core.Tasks Namespace