This post originated from an RSS feed registered with .NET Buzz
by Scott Hanselman.
Original Post: Forcing NAnt to build and run with a specific version of the .NET Framework
Feed Title: Scott Hanselman's ComputerZen.com
Feed URL: http://radio-weblogs.com/0106747/rss.xml
Feed Description: Scott Hanselman's ComputerZen.com is a .NET/WebServices/XML Weblog. I offer details of obscurities (internals of ASP.NET, WebServices, XML, etc) and best practices from real world scenarios.
If you're not careful, and you have both versions of the .NET Framework on your box
(1.0 and 1.1) NAnt will build your
stuff using .NET 1.0. Whether that's what you want or not, it's important to
be explicit.
There's two ways:
Add <property name="nant.settings.currentframework" value="net-1.1"/> to
your .build file(s).
or, to make the change to .NET 1.1 as the default, look in the NAnt.exe.config file
in the same directory as NAnt.exe.
In this XML config file, in /configuration/nant/framework/platform[@default] you'll
want to set that default attribute to "net-1.1" like this. Note: The ID
"net-1.1" corresponds to a named <framework> section
called "net-1.1" further down in the file that gives NAnt all the info it needs to
build on that version. NAnt can also be used to build Mono, at least as of version
0.28 of Mono.