【问题标题】:Problem with building with csc task in Ant在 Ant 中使用 csc 任务构建的问题
【发布时间】:2010-06-18 07:06:35
【问题描述】:

我有一个使用 csc 的 ant 构建目标:

<target name="compile">
    <echo>Starting compiling ServiceLauncher</echo>
    <csc optimize="true" debug="true" warnLevel="1"
             unsafe="false" targetType="exe" failonerror="true"
             incremental="false" mainClass = "ServiceLauncher.Launcher"
             srcdir="ServiceLauncher/Launcher/"
             outputfile="ServiceLauncher.exe" >

        <reference file="libs/log4net.dll"/>
        <define name="RELEASE"/>
    </csc>
</target>

当我运行它时,出现以下异常:

csc failed: java.io.IOException: Cannot run program "csc": CreateProcess error=2, 系统找不到指定的文件

但是,当我手动添加一个空的 ServiceLauncher.exe 时,它​​会正常运行,但永远不会正确构建 .exe 文件。

如何正确构建这个 .Net 项目“ServiceLauncher”?

【问题讨论】:

    标签: c# java ant build csc


    【解决方案1】:

    我的猜测是csc.exe 不在执行路径上。

    来自 csc 任务的文档:

    Windows 上的 csc.exe 或任何其他平台上的 mcs 必须在执行路径上,除非在可执行参数中指定了另一个可执行文件或该可执行文件的完整路径

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-10-14
      • 2013-05-09
      • 1970-01-01
      • 2013-06-23
      • 1970-01-01
      相关资源
      最近更新 更多