使用NANT执行VB Project时如何捕捉错误? [英] How to catch errors while executing VB Project using NANT?
问题描述
我们正在使用以下NANT脚本执行所有VB项目:仅是示例
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>
如果要在执行所有VB项目时遇到一些错误,我希望出现这种情况,它应该在命令提示符本身中显示错误,并且我不希望将错误消息显示为警报. 我尝试使用和$ {failure.message}.不适用于我:(请提出任何解决方案.
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.
推荐答案
对VB6 IDE/编译器使用/out filename
命令行参数来提供将接收错误消息的文件名.
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.
这篇关于使用NANT执行VB Project时如何捕捉错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!