Click here to Skip to main content
12,504,984 members (63,574 online)
Click here to Skip to main content
Add your own
alternative version


19 bookmarked

Introduction to NAnt

, 10 Aug 2007
Rate this:
Please Sign up or sign in to vote.
Writing NAnt scripts for NDoc, FxCop,NUnit. and NCoverage.


Nant is the scripting tool for the Dot Net platform. It is inspired from its java counterpart,

NAnt is an open source project, with a homepage at There

are links to many resources from this page. Additionally, there is an adjunct to NAnt called NAntContrib. It has a homepage at This project is for task contributions to NAnt that do

not make it into the core NAnt release. Occasionally, tasks in NAntContrib will make the

switch to NAnt.

NAnt Nomenclature

Just before we dive in, let us clarify some of the terminology that we will use when discussing


NAnt: The physical executable (and the associated tasks) that form the application.

NAnt script/build script/build file: An XML file describing a project comprised of one or

more targets and zero or more properties.

Project: The root node of a build script. Each script has one project.

Target: A subdivision of a project. A target is a discrete piece of work that can consist of

zero or more tasks. Targets can be dependent on each other.

Task: A task is a defined activity that NAnt will execute; for example, creating a directory

or zipping a file. There are many built-in tasks to NAnt, and we will look at the most valuable

of these in Chapter 3.

Property: An XML key/value pair that can be used to configure tasks and targets in a

more dynamic fashion. Property values can be overridden from the command line.

Installation Instructions:

Download the Nant executable from the Nant site, The latest version was 0.85 at the time of writing this article. Extract the executable to a local directory, say C:\Nant\. The binary executable for nant will be stored in C:\Nant\bin, which is Nant.exe. This exe will be responsible for executing your scripts. So

i. Either you have to dump your scripts to C:\Nant folder or

ii. Add the path (C:\Nant\bin) to your PATH environment variable.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Web Developer
India India
No Biography provided

You may also be interested in...


Comments and Discussions

QuestionHow to execute maven sonar command in NAnt Pin
Youzelin5-Nov-11 21:18
memberYouzelin5-Nov-11 21:18 
GeneralMy vote of 2 Pin
Trollslayer14-Aug-09 10:53
mentorTrollslayer14-Aug-09 10:53 
GeneralThe best Pin
Frygreen12-Aug-08 7:22
memberFrygreen12-Aug-08 7:22 

I do not understane why you got a grade of 2.0 only (so far).

For me, as a beginner, you wrote the best introduction do Nant I found so far

Congratulations - you get my 5
GeneralRe: The best Pin
prst12313-Aug-08 19:13
memberprst12313-Aug-08 19:13 
AnswerNANT is build tool desgined to setup central build servers Pin
377988621-May-08 7:16
member377988621-May-08 7:16 
Questionwhere's the gain? Pin
Mustafa Ismail Mustafa11-Sep-07 22:38
memberMustafa Ismail Mustafa11-Sep-07 22:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160919.1 | Last Updated 10 Aug 2007
Article Copyright 2007 by prst123
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid