Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can MSDeploy deploy only new or changed files?

I intend to use the web deploy feature of ASP.NET 4.0 for my site. Does anyone know if this feature does incremental deployments (i.e. only deploy changed or new files in the solution)?

Thanks

like image 743
GurdeepS Avatar asked Dec 29 '22 01:12

GurdeepS


2 Answers

MSDeploy does deploy only the new or changed files by default. But I've stumbled upon this question when I had found that for me it wasn't the case. I was using Angular CLI that copies the assets folder as-is, but file dates are lost on the way. And MSDeploy by default uses file dates to determine if a file had changed.

Here I've found a way to force MSDeploy to use checksums instead of file dates. You just need to add <MSDeployUseChecksum>True</MSDeployUseChecksum> in your first PropertyGroup in your .pubxml file (publish profile). Or, if you don't use a .pubxml file and use msdeploy directly instead, just supply a /p:MSDeployUseChecksum=true argument when invoking it. Works like a charm for my temporarily slow internet connection: reduced the deploy from 10 minutes to 10 seconds (most of the assets never change). Yay!

like image 84
evilkos Avatar answered Jan 14 '23 07:01

evilkos


Yes it does. It is really fast, also for solutions with many directories.

I've seen the deployment time of a big solution being reduced from 30 minutes to about 5. For smaller projects, the incremential deploy is done within seconds.

Edit: Due to several call backs: Have a look at this screenshot: enter image description here

Check out the radio buttons. (The image is taken from an article about web config transforms, that I've written in the past. Check out this link if you want to see the context of this screenshot)

like image 31
citronas Avatar answered Jan 14 '23 07:01

citronas