Scott Hanselman

Forcing NAnt to build and run with a specific version of the .NET Framework

June 22, 2004 Comment on this post [0] Posted in Nant | XML
Sponsored By

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.

            <platform name="win32" default="net-1.1">

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Hosting By
Hosted in an Azure App Service

Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.