Rushputin
Rushputin

Reputation: 131

MSBuild/WebDeploy - How to prevent it from deleting a folder and its contents

We're using TeamCity to automate MSBuild to use WebDeploy to push our application to our various servers.

For the most part, we've got this working, and great. One snag, though: we've got a folder that holds uploads that we don't want to have deleted during the publication.

How do I tell WebDeploy, "I know that folder's not in the compiled application. Ignore it. Just leave it alone."

Upvotes: 13

Views: 6044

Answers (1)

timamm
timamm

Reputation: 932

If you're using the dirPath, filePath, or contentPath providers, you can specify the DoNotDelete rule to block deletions of files on the destination computer that do not exist on the source. The syntax to add to the command line would be -enableRule:DoNotDelete. For more information, see the provider articles mentioned and Web Deploy Rules.

Upvotes: 16

Related Questions