Hi folks, hope you can help me as it looks to me like this should be a very simple problem but I've been going round in circles.
I have a target in an included build file to run msbuild on a .csproj file and it overwrites some of the settings in the proj file if certain nant properties are set. In particular I want to be able to set the OutputPath in msbuild only if there is a nant property 'msbuild.outputpath' set. My target is below: <target name="_msbuild" project="${msbuild.project}" description="Build using msbuild"> <msbuild target="${msbuild.target}" > <property if="${property::exists('msbuild.outputpath')}" name="OutputPath" value="${msbuild.outputpath}" /> </msbuild> </target> But when I run it with 'msbuild.outputpath' unset I get: Failed to start MSBuild. K:\nant\include.build(29,10): Property evaluation failed. Expression: ${msbuild.outputpath} ^^^^^^^^^^^^^^^^^^ Property 'msbuild.outputpath' has not been set. Total time: 0.1 seconds. But I thought if property::exists evaluates to false (as msbuild.outputpath is unset) the property task would not be evaluated. Am I missing something here, is it just not possible to stop nant processing the value argument of the property task? Is there maybe another way of achieving this without using an outer if block on the msbuild tas? Thanks Dave ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ NAnt-users mailing list NAnt-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nant-users