Geeks With Blogs
Liam McLennan
First, let me recommend Mike Robert's excellent article on setting up .NET solutions.

My preference is to use MSBuild to build the Visual Studio solutions, and NAnt for everything else. The trouble is, in the latest version of NAnt (0.86-beta1) the <solution> task does not support .NET 3.5.  The best work around I can find is to use the <exec> task to call MSBuild to build the solution. Here is a basic Nant build script that does this:

<?xml version="1.0" ?> 

project name="nant" default="compile" xmlns="">

property name="nant.settings.currentframework" value="net-3.5" />
<property name="project.rootdirectory" value="." />
<property name="solution.dir" value="src"/>
property name="solution.file" value="${solution.dir}/Mysolutionfile.sln"/>
property name="build.configuration" value="debug" />

<target name="compile">
<exec program="${framework::get-framework-directory(framework::get-target-framework())}\msbuild.exe"
commandline="${solution.file} /t:Clean /p:Configuration=${build.configuration} /v:q" workingdir="." />

Posted on Wednesday, April 30, 2008 8:45 PM | Back to top

Copyright © Liam McLennan | Powered by: