Marcelo
Marcelo

Reputation: 207

Exists a property to "Delete all existing files prior to publish" on a automated build?

I have a build where my webapp is being published, but the folder "_PublishedWebSites" is with some trash (files that existed before, but no more), the build isn't deleting the existing files, is only replacing matching files.

Can I set a property on the solution, csproj or even inside the build file to "Delete all existing files prior to publish" ?

Upvotes: 1

Views: 1785

Answers (1)

Derek Hunziker
Derek Hunziker

Reputation: 13141

You can delete the files and/or directories prior to publishing like so:

<RemoveDir Directories="$(MyDirectory)" Condition="Exists('$(TempDirectory)')" />
<Delete Files="$(MyFiles)" Condition="Exists('$(MyFiles)')" />

Upvotes: 1

Related Questions