Sunday, March 16, 2008

NAnt FTP Task

I came across the NAnt FTP task while automating the deployment of an application. This task is not included with NAnt. However, NAnt has made it really simple to install third party tasks. You can download the NAnt FTP task from:

To install this task you will need to do the following:

  1. Unzip the bin contents to your folder of choice. My choice was tools/nant/tasks/ftptask/

  2. Leverage the loadTasks task in your build file to load the assembly:

    <loadtasks assembly="${tools.dir}\nant\tasks\nantFtp\ftptask.dll" />

  3. That's it. Your finished. You can start to use the FTP task.

Here is an example of how I used the NAnt FTP task.

<loadtasks assembly="${tools.dir}\nant\tasks\nantFtp\ftptask.dll" />


<connection id="liveAuditToolConnection"


        username="Umm Your User Name"

        password="Umm Your Password" />


<target name="upload.application.only">

  <echo message="The application is being deployed to the live server"/>

  <ftp connection="liveAuditToolConnection" connectmode="PASSIVE">

    <put type="bin" localdir="${clickonce.dir}" remotedir="" flatten="false">

      <include name="${version}/**"/>

      <include name="setup.exe"/>

      <include name="index.aspx"/>

      <include name="${app.exe}.application"/>





Anonymous said...

Great thanks!

Anonymous said...

Did you do anything else besides those posted to get it to work? I tried your example as well as the examples from the task and it did not work. It connected, do CWD and also lists files and directories if showdironconnect="true" but would not get or put any file.

Arg! said...

it dont work any more :(

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: T
he type initializer for 'Sourceforge.NAnt.Ftp.Types.GetFileSet' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or
assembly 'log4net, Version=, Culture=neutral, PublicKeyToken=aaa0f432407c68df' or one of its dependencies. The system cannot find the
file specified.

Kristofer Krause said...

Nice. Even better if there was a delete, or remove, or recursive delete feature.

Anonymous said...

It doesn't find the files specified in a put element if you have a xmlns attribute in the project element.

Anonymous said...

qykxn [url=]tadalafil 20mg[/url] tznqbjg

Anonymous said...

Amuse look our cheapest prices for SOMA. Best sell guarantied. Self-indulgent Delivery
[url=]soma feedback[/url]
[url=]burried seven soma[/url]
[url=]soma bicycle fabrications[/url]
[url=]substitute for soma[/url]
[url=]soma slim[/url]
[url=]what are soma tabs[/url]
[url=]soma yoga studio[/url]
[url=]soma day spa miami[/url]
[url=]soma 250mg[/url]
[url=]cheap on line prescriptions for soma[/url]
[url=]soma bringer walkthrough[/url]
[url=]agusta medical soma[/url]
[url=]online soma with consultation[/url]
[url=]mp58 soma[/url]
[url=]gravis soma[/url]
[url=]soma atlanta ga[/url]
[url=]saturday soma[/url]
[url=]on line soma[/url]
[url=]cheapest place to buy soma[/url]
[url=]soma drug[/url]
[url=]soma led flashlights[/url]
[url=]wholesale soma cheap[/url]
[url=]carisoprodol domain soma pochta ru[/url]
[url=]soma stay in your system[/url]
[url=]soma and xanax death[/url]
[url=]beladona and soma[/url]
[url=]soma tablets round white pills cor103[/url]
[url=]love is as good as soma[/url]
[url=]soma apparell[/url]
[url=]nick cooper soma[/url]
[url=]0 dreampharmaceuticals online order soma[/url]
[url=]soma muscle relaxers[/url]
[url=]soma on broadway boulder[/url]

Anonymous said...

Prefer look our cheapest prices for SOMA. Conquer tender guarantied. Fast Articulation
[url=]soma hydrocodone las vegas cocktail[/url]
[url=]2410 v soma[/url]
[url=]soma article[/url]
[url=]natasha soma[/url]
[url=]soma supreme bed[/url]
[url=]mani soma[/url]
[url=]model workshops soma san francisco[/url]
[url=]soma wallace[/url]
[url=]soma city[/url]
[url=]negative publicity soma[/url]
[url=]soma adjustable office chair[/url]
[url=]soma chair[/url]
[url=]people increase workouts addicted to soma[/url]
[url=]florida pharmacies cheap soma free shipping[/url]
[url=]soma club houston tx[/url]
[url=]what makes up soma[/url]
[url=]u s mexican somas[/url]
[url=]can i shoot up somas[/url]
[url=]soma lending[/url]
[url=]what is soma scheduled as[/url]
[url=]over dose of soma[/url]
[url=]soma online shipped to canada[/url]
[url=]soma thoracic back chair[/url]
[url=]carisoprodol online buy soma[/url]
[url=]discount soma[/url]
[url=]best buy soma[/url]
[url=]soma cannabis[/url]
[url=]thomas soma[/url]

Anonymous said...

Hello! Can you tell me how i can register mail at google [url=]google[/url]

Anonymous said...

Hello! Can you tell me how i can register mail at google [url=]google[/url]

Amit Thakur said...
The Above link is not working.Its saying 404 error. can anyone make it up and running.