tags:

views:

224

answers:

2

Hi all,
I'm setting up a build server using NAnt (and CruiseControl.NET) and I'm currently writing the build file for all the assemblies (both in VB.NET/C#) in the application.
Unfortunately whem compiles most of the projects, NAnt signals several warnings which stop the building process. Since I know these warnings are almost unrealistic (the vast majority of this warning comes from code like

If object Is Nothing

which generates a warning like "A Null reference exception COULD result at runtime", emphasys is mine, of course) I would like to make NAnt just show them without stopping the building process.
Thanks in advance to anyone who will help

+1  A: 

If you're using the exec task to execute devenv.exe change it to execute devenv.com, this should print warnings to stdout (I think it's stdout, might be stderr) but warnings shouldn't stop the build.

Also, make sure your visual studio project settings don't treat warnings like errors.

Arnshea
I failed to mention it, but I was actually using the <solution> task which seems to have some problems especially when used to compile v.1.1 projects.
Turro
+1  A: 

CSC and MsBuild have parameters to specify to treat warnings as errors - you should check that these are set to false:

<property name="build.warnaserrors" value="false" />

MsBuild

<exec program="path/to/MSBuild.exe" workingdir="path/to/dir">
    <arg value="/p:TreatWarningsAsErrors=${build.warnaserrors}" />
    ....other args
</exec>

CSC

<csc warnaserror="${warnaserrors}"
    ...other args
></csc>
James Allen
Maybe the name of the property is misspelled between the property example ("warnmissingdocs") and the MsBuild/Csc ones ("warnaserrors")? Anyway this worked, thanks!
Turro
You're right I mispelled the properties. Have edited my post to fix it!
James Allen