I have a web application that I want to deploy using MSDeploy.
I have a Nant script that runs MSBuild and has the property DeployOnBuild set to true. It creates a deployment package that I use on a server.
What I want to do is to avoid that MSDeploy deletes the content of the destination folder before it deploys the new files. I can do it manually by adding -enableRule:DoNotDeleteRule to my command line, but I would like MSDeploy to do it manually. I really need some help with that.
I’m using Visual Studio 2010 and if there was a way to make this setting from there it would be optimal. If it’s possible to do it from Nant that also great.
Summary:
The deployment package created with MSBuild via Nant should have the flag -enableRule:DoNotDeleteRule by default.
We ended up using the Nant command for creating a bat file, and then we added the -enableRule to the command in that file:
The /T and /Y flags are used in MSDeploy to know whether you are testing the script (/T) or if you’re running it for real (/Y).
This is a workaround, but we’re satisfied with it.