Can we use nant to build .sln files in C #?

Is it possible to use nant to build .sln files in C #?

+4
source share
5 answers

The easiest approach in my experience is to use NAnt to invoke MSBuild and get MSBuild to create the solution file itself. An example is the Protocol Buffer File file .

I am using NAntContrib which has msbuild task:

 <property name="nantcontrib-dir" value="${path::combine(nant::get-base-directory(), '../../NAntContrib')}" overwrite="false" /> <loadtasks assembly= "${path::combine(nantcontrib-dir, 'bin/NAnt.Contrib.Tasks.dll')}" /> ... <target name="build" description="Builds all C# code"> <msbuild project="${src}/ProtocolBuffers.sln"> <property name="Configuration" value="${build-configuration}" /> </msbuild> </target> 
+8
source

msbuild is a task that can either simply build your solution or execute the entire msbuild script file:

 <target name="compile"> <msbuild project="xxx.sln"> <arg value="/property:Configuration=release" /> <arg value="/t:Rebuild" /> </msbuild> </target> 
+3
source

You can call msbuild as your main task.

+2
source

solution task can help.

+2
source

You can use the solution task, although this does not support VS2008 solutions outside of nant beta versions. It happens.

0
source

All Articles