When using msdeploy to do a sync operation, one of the things that MSDeploy checks to determine if a file should be synced or not is the attributes on the file (readonly, archive, etc.). If the attributes are different between the two copies of the file, then the file will be synced. Is there a way to tell MSDeploy to ignore file attributes when determining if a file should be synced or not?
Share
It is possible, however, not merely on the command line. You’d have to build a custom
DeploymentRuleHandler, like this:Compile that into an assembly (targeting .Net 3.5 for WebDeploy v2!) and put the assembly into the “Extensibility” subfolder in the WebDeploy folder (normally,
C:\Program Files\IIS\Microsoft Web Deploy V2\Extensibility).Then, you can easily leverage your custom rule when running msdeploy from the command-line by adding this argument:
Of course, that assembly needs to be present on both, the source and the target machine, of a sync operation.
Unfortunately, there’s no easier way of getting there!