I have a HelloNAnt.build file inside the directory:
D:\third party components\nant\WhatThis
My nant exe is placed at
C:\Program Files\nant
So I cd to D:\third party components\nant\WhatThis
, type in the following command line:
"C:\Program Files\nant\bin\nant.exe" HelloNAnt.build
I got a build failed error, saying target HelloNAnt.build
does not exist in this project.
What actually went wrong?
The content of HelloNAnt.build
:
<?xml version="1.0"?>
<project name="Hello World" default="hello">
<target name="hello">
<echo>Hello</echo>
</target>
</project>
Best Answer
You omitted the
-buildfile
option, which specifies the path to the buildfile that you want NAnt to run:However, in your case, you needn't provide any options at all. NAnt will search the current directory for a file with a
.build
extension and run it.