Answered by:
Avoid MSdeploy package deleting all target files

Question
-
User2019132272 posted
Hi, im am publishing to a win2003 server that has the Web Deployment Tools installed. The deployment package I create in VS 2010 deletes all the target files and only adds the files in the package. Is there any way to disable this deletion command so that it only replaces the files in the package?
Im using the following command to deploy the package: Lingbay.Web.deploy.cmd /y
Thanks,
Anders
Friday, February 5, 2010 10:46 AM
Answers
-
User1912363967 posted
Modify the deploy.cmd file and add -enableRule:DoNotDeleteRule to the end of the command in there.
For e.g. change the following command
msdeploy -verb:sync -source:package=c:\sourcepackage.zip -dest:auto
To
msdeploy -verb:sync -source:package=c:\sourcepackage.zip -dest:auto -enableRule:DoNotDeleteRule
- Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
Friday, February 5, 2010 2:12 PM
All replies
-
User1912363967 posted
just add the switch -enableRule:Donotdeleterule
You can read more about this here
Friday, February 5, 2010 1:02 PM -
User1973541685 posted
Hi Outze,
Found one link that talks about where this setting is located and there is a few others out there.
http://weblogs.asp.net/owscott/archive/2009/06/06/visual-studio-2010-1-click-publishing.aspx
Does it help for your situation?
Friday, February 5, 2010 1:16 PM -
User2019132272 posted
Hi thanks for your response. How do I add the switch? Currently im simply calling the deploy.cmd file that VS 2010 generates.
In the link you added it says its for Win 2008, im publishing to 2003 :/
Friday, February 5, 2010 1:26 PM -
User2019132272 posted
Hi Jamescoo, unfortunately its not possible to use the 1-click-publishing for win 2003 yet (not working in VS 2010 beta 2).
Friday, February 5, 2010 1:27 PM -
User1912363967 posted
Modify the deploy.cmd file and add -enableRule:DoNotDeleteRule to the end of the command in there.
For e.g. change the following command
msdeploy -verb:sync -source:package=c:\sourcepackage.zip -dest:auto
To
msdeploy -verb:sync -source:package=c:\sourcepackage.zip -dest:auto -enableRule:DoNotDeleteRule
- Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
Friday, February 5, 2010 2:12 PM -
User2019132272 posted
Hi thanks. That would do it, but then it won't be so automated as I wanted if I need to append that for each deploy - unless you have a batch command that can do just that :)
Friday, February 5, 2010 2:45 PM