Problem with building with csc task in Ant

Posted by Wing C. Chen on Stack Overflow See other posts from Stack Overflow or by Wing C. Chen
Published on 2010-06-18T07:06:35Z Indexed on 2010/06/18 7:13 UTC
Read the original article Hit count: 332

Filed under:
|
|
|
|

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

© Stack Overflow or respective owner

Related posts about c#

Related posts about java