msdeploy is taking too long from command line and less time using Visual Studio

647 views Asked by At

I am configuring my deployment using msdeploy(Web Deploy 3). When I use the Visual Studio the process of publication is pretty fast but when I use the command line it is taking too long.

The command I am using is:

msdeploy  -verb:sync 
          -source:contentPath=C:\Source\Project 
          -dest:contentPath=C:\inetpub\wwwroot\Project,
           computerName=https://ServerName:8172/msdeploy.axd,
           authType=Basic,
           username=administrator,
           password=password, -allowUntrusted

The msdeploy command was typed in multiple lines in order to provide a more easy and clear lecture

Do I need to setup anything else in order to provide a more faster deployment process?

1

There are 1 answers

1
chief7 On

This may be because MSDeploy defaults to a timestamp based file comparison. It could be faster from VS because you have already deployed from there and the timestamps are the same. Versus from the commandline where you are using a different source with different timestamps?

You can try changing MSDeploy to use a checksum file comparison instead using the -useCheckSum flag:

msdeploy -verb:sync -source:contentPath="C:\Test1" -dest:contentPath="C:\Test2" -usechecksum 

https://technet.microsoft.com/en-us/library/dd569089(v=ws.10).aspx

This blog post has more details about the MSDeploy file comparison:

http://www.dotnetcatch.com/2016/06/03/webdeploymsdeploy-quick-tip-only-deploy-changed-files/