How to catch errors while executing VB Project using NANT?

牧云@^-^@ 提交于 2019-12-11 08:13:28

问题


We are executing all the VB projects using below NANT script:Just example

<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 scenario if we encountered some error while executing all VB projects, it should display the errors in Command Prompt itself and i don't want the error message to be dispalyed as alerts. I have tried using and ${failure.message}.Not working for me :( Please suggest any solution.


回答1:


Use the /out filename command line argument to the VB6 IDE/compiler to give a filename which will receive error messages.

You can explore the other command line options with the /? command line option.



来源:https://stackoverflow.com/questions/24084562/how-to-catch-errors-while-executing-vb-project-using-nant

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!