I have a simple HelloWorld application that I'm trying to build using NAnt. However, even with the simplest of build files, I still cannot get it to work. Below is my HelloWorld.build file.
<?xml version="1.0"?>
<project name="Hello World" default="build">
<property name="nant.settings.currentframework" value="net-3.5"/>
<target name="build">
<echo>Hello</echo>
<exec program="${framework::get-framework-directory(framework::get-target-framework())}\msbuild.exe"
commandline="HelloWorld /t:Clean /p:Configuration=Debug /v:q" workingdir="." />
</target>
Here are the results.
C:\webdev\HelloWorld>c:\nant-0.86-beta1\bin\NAnt.exe build
NAnt 0.86 (Build 0.86.2898.0; beta1; 12/8/2007)
Copyright (C) 2001-2007 Gerry Shaw
http://nant.sourceforge.net
Buildfile: file:///C:/webdev/HelloWorld/HelloWorld.build
Target framework: Microsoft .NET Framework 2.0
Target(s) specified: build
[property] Target framework changed to "Microsoft .NET Framework 3.5".
BUILD FAILED
INTERNAL ERROR
System.NullReferenceException: Object reference not set to an instance of an object.
at NAnt.Core.FrameworkInfo.get_Version()
at NAnt.Core.Project.UpdateTargetFrameworkProperties()
at NAnt.Core.Tasks.PropertyTask.ExecuteTask()
at NAnt.Core.Task.Execute()
at NAnt.Core.Project.InitializeProjectDocument(XmlDocument doc)
at NAnt.Core.Project.Execute()
at NAnt.Core.Project.Run()
Please send bug report to [email protected].
Total time: 0 seconds.
Also, when I try to manually set the .NET framework to use, I get the following:
C:\webdev\HelloWorld>c:\nant-0.86-beta1\bin\NAnt.exe -t:net-3.5
NAnt 0.86 (Build 0.86.2898.0; beta1; 12/8/2007)
Copyright (C) 2001-2007 Gerry Shaw
http://nant.sourceforge.net
Microsoft .NET Framework 3.5 (net-3.5) is not installed, or not correctly configured.
Object reference not set to an instance of an object.
However, the config file does have an entry for .NET 3.5 .This is with NAnt-0.86-beta and Visual C# 2008 Express Edition. Am I completely off track? If so, does anyone perhaps have a template build file that can be reused?
Thank you.