使用时出错NAnt 中的标签

发布于 2024-12-08 00:22:51 字数 682 浏览 0 评论 0原文

<?xml version="1.0"?>
 <project name="Project" default="build">
 <property name="program" value="C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" />
 <property name="name.proj" value="C:\project\proj.csproj" />
 <target name="build">
   <exec program="${program}"commandline="\devenv.exe ${name.proj}"  />
 </target>
</project>

它的输出是....

Error in Script usage:The Correct usage is:C:\Program Files (x86)\Microsoft Visual
Studio 9.0\VC\vcvarsall.bat" [Option], where option= x86,ia64,or x86_ia64. 

但是当我给出x86选项时,它再次出现错误..“/是一个意外的标记”

请建议该怎么做。

<?xml version="1.0"?>
 <project name="Project" default="build">
 <property name="program" value="C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" />
 <property name="name.proj" value="C:\project\proj.csproj" />
 <target name="build">
   <exec program="${program}"commandline="\devenv.exe ${name.proj}"  />
 </target>
</project>

Its output is....

Error in Script usage:The Correct usage is:C:\Program Files (x86)\Microsoft Visual
Studio 9.0\VC\vcvarsall.bat" [Option], where option= x86,ia64,or x86_ia64. 

But when i gives the x86 option ,it again comes with error.."/ is an unexpected token"

Please suggest what to do.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

老娘不死你永远是小三 2024-12-15 00:22:51

你试过这个吗:

<exec program="${program}">
    <arg value="x86" />
</exec>

have you tried this:

<exec program="${program}">
    <arg value="x86" />
</exec>

source

遥远的她 2024-12-15 00:22:51

你应该这样做:

<exec program="${program}" commandline="x86"  />

我不确定你为什么将 devenv.exe 作为命令行传递。您可能想在单独的执行任务中执行此操作

You should be doing:

<exec program="${program}" commandline="x86"  />

I am not sure why you are passing devenv.exe as commandline. You probably want to do that in a separate exec task

风铃鹿 2024-12-15 00:22:51

这是从 VSS 获取最新版本的示例 EXEC

<target name="getlatest" >
       <property name="path.cmd.exe" value="C:\WINDOWS\system32\CMD.EXE"/>
          <property name="path.vss.bat" value="C:\Work\build\DailyBuild\nAnt\VSSGET.bat"/>

    <echo>
    -----------------------------------------------------------------------------------------------------------------
    -----------------------------------------------------------------------------------------------------------------
    TASK : GET LATEST FROM VSS
    -----------------------------------------------------------------------------------------------------------------
    -----------------------------------------------------------------------------------------------------------------
    </echo>
    <echo message="Task Start at: ${datetime::now()}" />

   <loadtasks assembly="nantcontrib-0.85/bin/NAnt.Contrib.Tasks.dll" />         

    <exec program="${path.cmd.exe}">
        <arg value="/C"  />     
        <arg value="${path.vss.bat}"  />
     </exec>
</target>

Here is a sample EXEC for get latest from VSS

<target name="getlatest" >
       <property name="path.cmd.exe" value="C:\WINDOWS\system32\CMD.EXE"/>
          <property name="path.vss.bat" value="C:\Work\build\DailyBuild\nAnt\VSSGET.bat"/>

    <echo>
    -----------------------------------------------------------------------------------------------------------------
    -----------------------------------------------------------------------------------------------------------------
    TASK : GET LATEST FROM VSS
    -----------------------------------------------------------------------------------------------------------------
    -----------------------------------------------------------------------------------------------------------------
    </echo>
    <echo message="Task Start at: ${datetime::now()}" />

   <loadtasks assembly="nantcontrib-0.85/bin/NAnt.Contrib.Tasks.dll" />         

    <exec program="${path.cmd.exe}">
        <arg value="/C"  />     
        <arg value="${path.vss.bat}"  />
     </exec>
</target>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文