tags:

views:

68

answers:

1

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 manually add in an empty ServiceLauncher.exe.

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

+1  A: 

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

Andrew Cox