views:

775

answers:

1

Good day.

I'm trying to deploy a web application using NAnt. It is current zipped using the NAnt ZIP task.

I can try calling MSDeploy from NAnt but I don't think MSDeploy was written for such deployments.

I can also try using NAnt task.

Does anybody have suggestions as to what approach can save me the most time?

+2  A: 

Using the aspnet compiler is the simplest way and gets you access to all cl arguments which is not available on nant tasks. Not sure why it's so.

Here's what I do

<property name="aspnetcomplier" value="C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_compiler.exe" />
  <target name="deploy">
    <mkdir dir="${output.dir}" />
    <exec program="${aspnetcomplier}">
      <arg value="-v" />
      <arg value="/trunk" />
      <arg value="-p" />
      <arg value="${source.dir}\Root" />
      <arg value="-f" />
      <arg value="${output.dir}" />
    </exec>
  </target

Nothing complicated.Works like a charm.
P.S. Dont forget to do a iisreset /stop and /start

  <target name="stop.iis" >
    <servicecontroller action="Stop" service="w3svc" timeout="10000" verbose="true" />
  </target>

  <target name="start.iis" >
    <servicecontroller action="Start" service="w3svc" timeout="10000" verbose="true" />
  </target>
Cherian
Thanks! That really helped.