Running NAnt is simple once you have it installed, just type NAnt. Type NAnt -help
to get usage information.
Specifying the Build File
When nothing is specified, NAnt looks for a file ending with .build, e.g. NAnt.build, in the current directory. If found, it uses that file as the build file. If more than one file is found you need to specify the build file using the -buildfile option (see below).
If you use the -find option, NAnt will search for a build file in the parent directory, and so on, until the root of the file system has been reached. To make NAnt use another build file, use the command-line option -buildfile:file, where file is the build file you want to use.
Specifying Targets
You can specify one or more targets that should be executed. When omitted, the target that is specified in the default attribute of the <project> tag is used.
The -projecthelp option prints out the description of the project, if it exists, followed by a list of the project's targets. First those with a description, then those without one.
Setting Properties
To override properties specified in the build file use the -D:property=value
option, where property is the name of the property, and value is the value for that property.
Examples
Run NAnt using the file ending in *.build.xml file in the current directory, on the default target:
NAnt
Run NAnt using the ProjectName.build file in the parent directory, on the default target:
NAnt -buildfile:..\ProjectName.build
Run NAnt using the default build file in the current directory, on a target called clean:
NAnt clean
Runs NAnt using the default build file in the current directory, first on the clean target and then on the dist target while setting the debug property to false. This could, for example, make a release distribution from scratch:
NAnt -D:debug=false clean dist