0

We have a few big projects which we use Publishing with in VS2010 with IIS7. We are publishing with the "Web Deploy" options. Now when User1 publishes for the very first time all files will be uploaded, will this user make an alteration in a file and publish again only the changed file will be published. But User2 is publishing later (same project), but VS/IIS will upload ALL files again, while maybe only 1 file was changed. After uploading all the files again, User1 will again have to upload ALL files too!

Very annoying behavior and projects with sizes of 200mb take almost 30 minutes to publish. Is there a setting that IIS/VS can check better if a file has changed or not?

Roger Far
  • 341
  • 5
  • 17

1 Answers1

2

You need only to publish once per application/machine (although you can publish on a per root conf/machine). Afterwards (At least in Web Deploy 2.0) you can synchronise by doing msdeploy -verb:sync -source:webServer -dest:webServer,computerName=Server2

It is explicitly mentioned that

A sync operation gets a dump of the source, a dump of the destination, and then does a node-by-node comparison of the results. Rules and link extensions check every node to determine what must be added, deleted, or updated. For more information about rules and link extensions, see Web Deploy Rules and Web Deploy Link Extensions.

EDIT 1: The point of msdeploy is so it could be part of continuous integration. You can probably write a nice script that will be executed everytime you make a build. Having said that if you go to VS post build events you can add that script. The problem you mentioned might be an ACL and I guess you can either ignore it by ignoreError or make a final deploy that will resolve the ACL from one user and then sync from that user only. The latter will increase security as well.

user
  • 1,408
  • 8
  • 10
  • Ok I will look into this, but does it mean it will upload all files first before it will compare, or will it use a filelist? – Roger Far Sep 19 '11 at 14:27
  • It will use a 'filelist',compare source and dest by doing a dump and CRUD accordingly, thus keeping everything into sync but NOT by copying everything over. It also gives quite a nice output. This could also be of use http://jeffreypalermo.com/blog/automating-asp-net-mvc-deployments-using-web-deploy/ – user Sep 19 '11 at 15:31
  • shame that this cannot be configured directly in Visual Studio 2010.. – Roger Far Sep 19 '11 at 20:41
  • i tried to get your solution to work but it does not. I get the error: Verbose: Source filePath (213_6.png) does not match destination (Deploy Static\213_6.png) differing in attributes (lastWriteTime['07/26/2011 07:55:21','07/21/2011 10:56:43']). Update pending. It still tries to update the file because another user has published before to this point. – Roger Far Sep 20 '11 at 06:37
  • I have update my answer. – user Sep 20 '11 at 11:38
  • Problem is that msdeploy will make a changeset based on lastWriteTime, this property will be changed when user B publishes. – Roger Far Sep 20 '11 at 12:00
  • But that's the whole point not to let each user publish. But sync under one user. If you are only concerned about not uploading everything then install dropbox/make a shared folder and copy/paste to it. – user Sep 20 '11 at 12:05
  • In our company we have big projects that can be updated by multiple users, there is no point of using dropbox etc, then I can better install a custom rsync script :) – Roger Far Sep 20 '11 at 12:37