Hi all,

 

I’m new to NAnt and C#. I come from java side and now I want to make my first Nant build file. The app has some class files which are saved in a separate src path. The file structure is as follows:

 

-- docs/

-- libs/

-- src/Framework

-- src/Gui

-- src/Io

-- src/Util

 

App.xml

App.build

App.csproj.user

App.csproj

App.log.config

App.ndoc

App.ico

AssemblyInfo.cs

App.sln

 

My build file looks as follows:

 

<?xml version="1.0"?>

<project name="App" default="run">

<property name="base.dir" value="."/>

            <property name="dest.dir" value="${base.dir}"/>

            <property name="lib.dir" value="${base.dir}/libs"/>

            <property name="src.dir" value="${base.dir}/src"/>

            <property name="build.dir" value="${dest.dir}/bin"/>

 

            <property name="name" value="App"/>

            <property name="version" value="1.000"/>

            <property name="filename" value="${name}-${version}.exe"/>

            <property name="debug" value="true"/>

           

            <target name="init">

                        <mkdir dir="${build.dir}" />

            </target>

 

            <target name="clean" description="this clean all compiled files such as *.exe and *.pdb files">

                <delete>

                    <fileset>

                        <include name="${build.dir}/**/*.exe"/>

                        <include name="${build.dir}/**/*.pdb"/>

                    </fileset>

                </delete>

            </target>

           

            <target name="build" depends="init" description="build the application">

                        <csc target="winexe" output="${build.dir}/${filename}" debug="${debug}" doc="${base.dir}/App.xml">

                                   <sources>

                                               <include name="${src.dir}/**/*.cs"/>

                                   </sources>

                                   <references>

                                               <include name="${lib.dir}/*.dll"/>

                                               <include name="System.dll" />

                                               <include name="System.Drawing.dll" />

                                               <include name="System.Windows.Forms.dll" />

                                   </references>

                                   <resources dynamicprefix="true" prefix="App">

            <include name="${src.dir}/**/*.resx" />

                        </resources>                                       

                        </csc>

 

            </target>

</project>

 

The first compilation attempt works but the application won’t start without error. I opened the windows task manager and look at start up. The app was seen short in the process list and disappear. I was looking for the reason and found some threads in the mailing list, that a <resources> block should be included for windows apps. After that change the compilation ends with an compiling error:

 

BUILD FAILED

 

The SDK for the 'net-2.0' framework is not available or not configured.

 

I’m totally confused now. I only want to organize the file structure of the C# project and want to make an Nant build file which works correctly.

 

Who can help ?

 

Thanks in forward

Cando

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to