tags:

views:

233

answers:

2

I'm trying to build a VS 2008 solution in NAnt, but it seems msbuild stops the build process after the first compilation errror has occured.

In MSBuild there is a "ContinueOnError=true" or "StopOnFirstFailure=false" attribute, but how to specify this in NAnt ? The failonerror="false"does not solve the problem:

A: 

I need to confess that this is only a first guess but have you tried passing ContinueOnError=true as property to MSBuild?

Assuming you use the NAntContrib msbuild task you have:

<msbuild project="${projectfile.path}">
  <property
    name="ContinueOnError"
    value="true" />
</msbuild>

Or with exec task:

<exec program="${msbuild.exe.path}">
  <arg value="&quot;${projectfile.path}&quot;" />
  <arg value="/p:ContinueOnError=true" />
</exec>

Wouldn't it be perfect if it was that simple?

The Chairman
but I read somewhere that the "msbuild" task is not compatible with vs 2008 projects /.NET 3.5 , only with 2003 or 2005
It is compatible. Read my comment on answer http://stackoverflow.com/questions/1195389/msbuild-task-or-msbuild-exe-with-nant/1202121#1202121. You can also try the <exec> tasks as proposed there.
The Chairman
A: 

I have doing configuration management with Nant and CC.Net for a while now. I my experience I would not recommed using the Nant MSBuild task, instead the easiest way is creating and task, create a .bat file that the task executes. There are several reasons that would recommend using the command line Visual Studio, for one MSI packages are not easily build with Nant, even if you use contrib. Also it should eliminate your Nant continue on error request, Devenv should automatically continue to build even if one project fails. Also if you use this method you will not have to worry about changing nant and nant contrib to handle 3.5. If you used Cruise control you will still see your build output in your XML file.

---------2.0 --------

"C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv" C:\YourProject\YourSoultion.sln /Rebuild release

----------3.5--------

"C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv" C:\YourProject\YourSoultion.sln /Rebuild release

Kirit Chandran