Using MSBuild to copy a website to Production, while REALLY skips immutable files

I use MSBuild to publish a website, and then copy the published website to a web server on the same network. I set the copy command to "SkipUnchangedFiles".

This works smoothly, but Skip Unchanged will not work, because when I use AspNetCompiler to publish a website, each file is “new” - its date is set at the time of publication, so even if the contents of this file have not changed, the time stamp is different therefore it is copied anyway.

Is there a workaround that will prevent copying a file whose contents have not changed?

+3
source share
2 answers

Depending on how you publish the site, you can do an Incremental Build instead of a full build.

0
source

There is no existing process for this, since the deployment process does not know about the target deployment file system.

If you knew you could use diff with a tool such as after a comparison , then only capture exploded binaries and copy them across.

To automate this, you may have to delve into writing msbuild goals or post scripts.

0
source

Source: https://habr.com/ru/post/1707067/


All Articles