How to catch errors when running a VB project using NANT?

We execute all VB projects using the below NANT script: Example only

<target name="VBCompile" > <property name="failure.reason" value="VBCompile" /> <trycatch> <try> <foreach item="File" property="FileName" in="${VBProj.dir}"> <echo message="Creating Dll from: $:{FileName}" /> <exec basedir=${VBProj.dir} program=${VB6.exe} commandline=/MAKE ${FileName} outdir ${VBDll.dir} </foreach> </try> <catch> <fail message="${failure.reason}"/> </catch> <finally> //..some codes </finally> </trycatch> </target> 

I want the script, if we encounter some error while executing all the VB projects, should display errors on the command line itself, and I do not want the error message to appear as alerts. I tried using and $ {fail.message}. Doesn't work for me :( Please suggest any solution.

+1
source share
1 answer

Use the /out filename command line argument for the VB6 IDE / compiler to give the name of the file that will receive the error messages.

You can examine other command line options with the /? .

0
source

Source: https://habr.com/ru/post/1274740/


All Articles