如何防止 MSDeploy 在我的项目中删除额外的文件夹? [英] How do I keep MSDeploy from deleting extra folders in my project?

查看:15
本文介绍了如何防止 MSDeploy 在我的项目中删除额外的文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 Team city 中使用 MSBuild 运行程序来构建我的项目并将其部署到暂存环境.除了它不断删除我位于项目根目录中的存储库文件夹之外,一切都运行良好.

I am using the MSBuild runner in Team city to build and deploy my project to a staging environment. Everything works perfectly except for the fact that it keeps removing my repository folder located in the root of the project.

在 Visual Studio 2010 中,发布配置文件对话框中有一个复选框,显示在目标上保留额外文件(不要删除)"

In Visual Studio 2010 there is a check box in the publish profile dialog that says "Leave extra files on destination (do not delete)"

有没有办法用 MSBuild 完成同样的事情?

Is there a way to accomplish the same thing with MSBuild?

<Target Name="Deploy" DependsOnTargets="Build;Test">
        <MSBuild Projects="MyProject.sln" Properties="Configuration=$(Configuration); username=username; password=password; DeployOnBuild=True; DeployTarget=MSDeployPublish; MSDeployPublishMethod=WMSVC; MSDeployServiceUrl=https://DEVWEB01:8172/MsDeploy.axd; DeployIISAppPath=MyProject.$(Configuration); AllowUntrustedCertificate=True;"/>
</Target>

推荐答案

找到答案了!

您需要做的就是将以下属性添加到 Properties 属性:

All you need to do is add the following property to the Properties attribute:

SkipExtraFilesOnServer=True;

SkipExtraFilesOnServer=True;

这篇关于如何防止 MSDeploy 在我的项目中删除额外的文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆