开发者

Problem with building with csc task in Ant

I have an ant build target using csc:

<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>

When I run it, the following exception comes up:

csc failed: java.io.IOException: Cannot run program "csc": CreateProcess error=2, The system cannot find the file specified

However, it runs without the exception but never correctly builds the .exe file, when I manual开发者_如何学运维ly add in an empty ServiceLauncher.exe.

How can I correctly build this .Net project "ServiceLauncher"?


My guess is that csc.exe is not on the execute path.

From the documentation for the csc task:

csc.exe on Windows or mcs on any other platform must be on the execute path, unless another executable or the full path to that executable is specified in the executable parameter

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜