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:  http://www.spinthemoose.com/~ftptask/

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"

        server="YourServerName"

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

    </put>

  </ftp>

</target>

11 comments:

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=1.2.1.40796, 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=http://www.milesplit.us/members/Tadalafil/]tadalafil 20mg[/url] tznqbjg

Anonymous said...

Hi!
Amuse look our cheapest prices for SOMA. Best sell guarantied. Self-indulgent Delivery
[url=http://vmtoolkit.com/members/Buy+motrin+in+Michigan.aspx]soma feedback[/url]
[url=http://vmtoolkit.com/members/Doxycycline+buy+generic.aspx]burried seven soma[/url]
[url=http://vmtoolkit.com/members/Acyclovir+pharmacy+insurance+approval+overnight.aspx]soma bicycle fabrications[/url]
[url=http://vmtoolkit.com/members/Acyclovir+prescription+cod.aspx]substitute for soma[/url]
[url=http://vmtoolkit.com/members/Buy+doxycycline+in+Maine.aspx]soma slim[/url]
[url=http://vmtoolkit.com/members/Nolvadex+cash+buy.aspx]what are soma tabs[/url]
[url=http://vmtoolkit.com/members/Buy+augmentin+in+Missouri.aspx]soma yoga studio[/url]
[url=http://vmtoolkit.com/members/Levothyroxine+next+day+cash+on+delivery.aspx]soma day spa miami[/url]
[url=http://vmtoolkit.com/members/Zovirax+online+purchase.aspx]soma 250mg[/url]
[url=http://vmtoolkit.com/members/Zithromax+free+fedex.aspx]cheap on line prescriptions for soma[/url]
[url=http://vmtoolkit.com/members/Buy+aldactone+in+Arkansas.aspx]soma bringer walkthrough[/url]
[url=http://vmtoolkit.com/members/Phentermine+buy+generic.aspx]agusta medical soma[/url]
[url=http://vmtoolkit.com/members/Shipping+buy+overnight+buy+lexapro.aspx]online soma with consultation[/url]
[url=http://vmtoolkit.com/members/Buy+tetracycline+without+credit+card.aspx]mp58 soma[/url]
[url=http://vmtoolkit.com/members/Zocor+buy+generic+physician.aspx]gravis soma[/url]
[url=http://vmtoolkit.com/members/Buy+altace+in+New+Hampshire.aspx]soma atlanta ga[/url]
[url=http://vmtoolkit.com/members/Mexico+shipping+cheap+nolvadex.aspx]saturday soma[/url]
[url=http://vmtoolkit.com/members/Mexico+fedex+cheap+ativan.aspx]on line soma[/url]
[url=http://vmtoolkit.com/members/Delivery+nextday+biaxin.aspx]cheapest place to buy soma[/url]
[url=http://vmtoolkit.com/members/India+buy+canadian+lamisil.aspx]soma drug[/url]
[url=http://vmtoolkit.com/members/Consult+cheap+tamiflu.aspx]soma led flashlights[/url]
[url=http://vmtoolkit.com/members/Motrin+next+day+cod.aspx]wholesale soma cheap[/url]
[url=http://vmtoolkit.com/members/Overnight+no+consult+fluconazole.aspx]carisoprodol domain soma pochta ru[/url]
[url=http://vmtoolkit.com/members/Buy+topamax+in+Idaho.aspx]soma stay in your system[/url]
[url=http://vmtoolkit.com/members/Delivery+generic+synthroid.aspx]soma and xanax death[/url]
[url=http://vmtoolkit.com/members/Overnight+cod+accepted+cephalexin.aspx]beladona and soma[/url]
[url=http://vmtoolkit.com/members/Phentermine+doctors+UK+where.aspx]soma tablets round white pills cor103[/url]
[url=http://vmtoolkit.com/members/Aciphex+prescription+cod+free+fedex.aspx]love is as good as soma[/url]
[url=http://vmtoolkit.com/members/Escitalopram+buy+generic.aspx]soma apparell[/url]
[url=http://vmtoolkit.com/members/Overnight+cheap+hydrochlorothiazide.aspx]nick cooper soma[/url]
[url=http://vmtoolkit.com/members/Buy+fluoxetine+in+Connecticut.aspx]0 dreampharmaceuticals online order soma[/url]
[url=http://vmtoolkit.com/members/Buy+effexor+in+San+Antonio.aspx]soma muscle relaxers[/url]
[url=http://vmtoolkit.com/members/Buy+clomiphene+in+California.aspx]soma on broadway boulder[/url]

Anonymous said...

Hello!
Prefer look our cheapest prices for SOMA. Conquer tender guarantied. Fast Articulation
[url=http://blogs.opisnet.com/members/Buy+augmentin+in+San+Jose.aspx]lamisil[/url]
[url=http://blogs.opisnet.com/members/Viagra+tramadol+cialis+tablets.aspx]soma hydrocodone las vegas cocktail[/url]
[url=http://blogs.opisnet.com/members/Order+cialis+generic+viagra.aspx]2410 v soma[/url]
[url=http://blogs.opisnet.com/members/Carisoprodol+buy+generic.aspx]soma article[/url]
[url=http://blogs.opisnet.com/members/Saturday+cheap+percocet.aspx]natasha soma[/url]
[url=http://blogs.opisnet.com/members/Buy+effexor+in+New+Mexico.aspx]soma supreme bed[/url]
[url=http://blogs.opisnet.com/members/Order+sildenafil+without+rx.aspx]mani soma[/url]
[url=http://blogs.opisnet.com/members/Buy+zovirax+in+Tennessee.aspx]model workshops soma san francisco[/url]
[url=http://blogs.opisnet.com/members/Proscar+cod+overnight+overnight+cod.aspx]soma wallace[/url]
[url=http://blogs.opisnet.com/members/Cialis+pharmacy.aspx]soma city[/url]
[url=http://blogs.opisnet.com/members/Overnight+cod+norvasc.aspx]negative publicity soma[/url]
[url=http://blogs.opisnet.com/members/Tetracycline+order+delivery+generic.aspx]soma adjustable office chair[/url]
[url=http://blogs.opisnet.com/members/Fluconazole+cod+overnight+overnight+cod.aspx]soma chair[/url]
[url=http://blogs.opisnet.com/members/Fluconazole+free+fedex+medication.aspx]people increase workouts addicted to soma[/url]
[url=http://blogs.opisnet.com/members/Synthroid+india+discount+cheap.aspx]florida pharmacies cheap soma free shipping[/url]
[url=http://blogs.opisnet.com/members/Motrin+india+discount.aspx]soma club houston tx[/url]
[url=http://blogs.opisnet.com/members/Delivery+purchase+amoxicillin.aspx]what makes up soma[/url]
[url=http://blogs.opisnet.com/members/India+buy+valtrex.aspx]u s mexican somas[/url]
[url=http://blogs.opisnet.com/members/Saturday+cheap+tamoxifen.aspx]can i shoot up somas[/url]
[url=http://blogs.opisnet.com/members/Phentermine+no+prescription+for+sale+with+no+prescription+requir.aspx]soma lending[/url]
[url=http://blogs.opisnet.com/members/Hydrochlorothiazide+shipping.aspx]what is soma scheduled as[/url]
[url=http://blogs.opisnet.com/members/Without+rx+ciprofloxacin.aspx]over dose of soma[/url]
[url=http://blogs.opisnet.com/members/Where+can+i+buy+bactrim.aspx]soma online shipped to canada[/url]
[url=http://blogs.opisnet.com/members/Buy+dilantin+in+Connecticut.aspx]soma thoracic back chair[/url]
[url=http://blogs.opisnet.com/members/Rx+cheap+zoloft.aspx]carisoprodol online buy soma[/url]
[url=http://blogs.opisnet.com/members/Buy+levaquin+in+Tennessee.aspx]discount soma[/url]
[url=http://blogs.opisnet.com/members/Hydrochlorothiazide+stock+cheap.aspx]best buy soma[/url]
[url=http://blogs.opisnet.com/members/Buy+lamisil+in+Colorado.aspx]soma cannabis[/url]
[url=http://blogs.opisnet.com/members/Physician+ultram.aspx]thomas soma[/url]

Anonymous said...

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

Anonymous said...

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

Amit Thakur said...

http://www.spinthemoose.com/~ftptask/
The Above link is not working.Its saying 404 error. can anyone make it up and running.