tags:

views:

244

answers:

3

Hi

I am using nant-0.90-alpha1 to build asp.net 3.5 web site. I am unable do that. When I am using msbuild , it throwing error saying unknown tag msbuild.
How can I build asp.net 3.5 website using nant?

Thanks
nRk

A: 

<msbuild> task is part of NAntContrib.

The Chairman
Thanks, Are there any examples or sample using NAntContrib with nAnt? Any samples or examples are very helpfule. Thanks
nRk
I found a question similar to Yours: http://stackoverflow.com/questions/685571/build-vs2008-projects-with-net-2-0-net-3-5-using-nant
The Chairman
Hi thanks, I did the same thing but it is still giving the same error .....
nRk
A: 

The <msbuild> task must be imported into your build script. Put the following element somewhere within your <project> element.

<project ...>

    <loadtasks assembly="C:\Program Files\NAntContrib\NAnt.Contrib.Tasks.dll"/>

    ...
</project>

I believe NAnt will also pick up additional task libraries if the dlls are placed in the NAnt bin folder.

Peter Lillevold
Hi Peter, thanks, I downloaded ncover from sourceforge, but i didn't find as you specified.
nRk
@nrk: sorry for the confusion! I pasted the wrong path in there. See my updated answer.
Peter Lillevold
+1  A: 

The CodeCampServer project provides good examples for a variety of tasks using nant to build MS projects including using MSBuild. However it doesn't use the msbuild task. Here's an excerpt from the common.build file from CodeCampServer:

<target name="compile" depends="init">
    <echo message="Build Directory is ${dir.build}" />
    <exec program="${framework::get-framework-directory(framework::get-target-framework())}\msbuild.exe"
              commandline="${file.solution} /t:Clean /p:Configuration=${project.config} /v:q" workingdir="." />
    <exec program="${framework::get-framework-directory(framework::get-target-framework())}\msbuild.exe"
              commandline="${file.solution} /t:Rebuild /p:Configuration=${project.config} /v:q" workingdir="." />
</target>
pmawhinney