Search code examples
asp.net.netvb.netbuildnant

Using Nant to build and deploy asp.net, vb.net , framework 1.1


How can I use properly Nant to build and deploy an asp.net project developed using asp.net , vb.net and .net framework 1.1?

I tried with this build file:

<?xml version="1.0" ?>
<project name="MyWebProj" default="build" basedir=".">
    <description>...</description>
    <property name="debug" value="true" overwrite="false"
    />
    <property name="basename" value="MyWebProj" />
    <target name="build">
        <mkdir dir="NantBIN" />
        <vbc target="library" output="NantBIN/${basename}.dll" debug="${debug}">
            <sources>
                <include name="*.vb" />
            </sources>
        </vbc>
    </target>
</project>

And I run this bat file:

@echo off bin\nant -t:net-1.1 -buildfile:.MyWebProjPath pause

Solution

  • First of all, thank you for all the answers and advices. This is how I finally resolved the problem.I use this as the build file:

    <?xml version="1.0"?><project name="..." default="rebuild" basedir=".">
    <target name="rebuild" depends="build">
        <call target="build.copy"/>
    </target>
    <target name="build" description="Build all targets.">
        <call target="build.project"/>
    </target>
    <target name="build.project">
        <solution configuration="${configuration}" solutionfile="${solutionName}" outputdir="${expected.output}">
            <webmap>
                <map url="${webproj.url}" path="${webproj.name}" />
            </webmap>
        </solution>
    </target>
    <target name="build.copy">
        <copy  todir="${path.to.deploy}" overwrite="true">
            <fileset basedir=".">
                ...
                <include name="**\*.asp" />
                <include name="**\*.aspx" />
                <include name="**\*.css" />
                <include name="**\*.js" />
                ...
            </fileset>
        </copy>
    </target>
    

    And I run this bat file (is important to set -t:net-1.1 to specify the .net framework version ):

    bin\nant -t:net-1.1 -buildfile:.MyWebProjPath