【问题标题】:run nant build file in command prompt using c#使用 c# 在命令提示符下运行 nant 构建文件
【发布时间】:2010-05-28 10:45:41
【问题描述】:

我现在有一个带有 nant 的构建文件,我需要做的就是使用 c# 在命令提示符下执行它 我尝试了以下但我无法构建它..

System.Diagnostics.Process.Start("exe -buildfile:d:\buildfile.build);

当我直接通过 cmd 提示符运行时,它正在工作

【问题讨论】:

    标签: c# nant command-prompt


    【解决方案1】:

    您是否将 nant 设置为环境变量?

    System.Diagnostics.Process.Start("nant.exe -buildfile:d:\buildfile.build);
    

    【讨论】:

    • 不,你能告诉我如何设置环境,我只是指定 nant 路径,如“D:\\nant\\bin\\Nant.exe /build D:\\\buildfile.build
    • 如果您指定完整路径,它应该可以工作 - 您收到的错误消息是什么?更新您的 PATH 环境变量以包含 \bin(对于我的设置,它是 C:\nant-0.86\bin)。管理环境变量见这篇文章——microsoft.com/resources/documentation/windows/xp/all/proddocs/…
    • 您也可以将 buildfile.build 重命名为默认构建 -- 然后您不必指定 -buildfile:d:\buildfile.build 只需在目录中运行 NANT
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-07-07
    • 1970-01-01
    • 1970-01-01
    • 2020-01-12
    • 2017-01-09
    • 2011-08-12
    • 2015-03-28
    相关资源
    最近更新 更多