Web部署忽略SkipExtraFilesOnServer通过设定的MSBuild [英] Web Deploy ignores SkipExtraFilesOnServer set by MSBuild

查看:647
本文介绍了Web部署忽略SkipExtraFilesOnServer通过设定的MSBuild的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的MSBuild我们CruiseControl的服务器上创建一个Web部署包来部署我们的Web应用程序。在部署一切都没有在包将我们的服务器上删除。

I'm using MSBuild to create a Web Deploy Package on our CruiseControl Server to Deploy our web applications. On deployment everything not in the package will be deleted on our servers.

我试过设置为true选项SkipExtraFilesOnServer选项。但它是由Web部署忽略

I tried the option SkipExtraFilesOnServer option set to true. But it is ignored by Web Deploy

<Target Name="CreateDeploymentPackage">
    <MSBuild Projects="$(Web)" Targets="Package"
      properties="Platform=$(Platform);
      Configuration=$(Configuration);
      DeployOnBuild=False;
      DeployTarget=Package;
      SkipExtraFilesOnServer=True;
      MSDeployUseChecksum=True;
      PackageLocation=$(DeployDirectory)\_PublishedWebsites\DeployPackage\$(CurrentProject).zip;
      PackageAsSingleFile=True;
      _PackageTempDir=$(PackageOutputDir)\temp;">
    </MSBuild>
</Target>

这是为什么不工作?每一个文件,我觉得说它应该。

Why is this not working? Every documentation I find says it should.

推荐答案

我不跟着你100%,但是,我想我明白这里发生了什么。这里是我的你的情况了解。

I'm not following you 100% but, I think I understand what's happening here. Here is my understanding of your situation.

您已经配置了构建服务器做到以下几点。

You've configured your build server to do the following.


  1. 使用msbuild.exe构建一个Web部署包

  2. 您已经设置 SkipExtraFilesOnServer = TRUE 创建包时

  3. 使用msdeploy.exe发布的Web部署包

这是你很可能会碰到的问题是,当包被发布到服务器。当通 SkipExtraFilesOnServer = TRUE 被翻译成该msdeploy选项 -enableRule:DoNotDeleteRule 。发布以你的情况,包时,这是应用(和相关的)。现在,你需要确保当包被发布的的服务器的选项设置。该选项不可嵌包,无论如何。

The issue that you are likely running into is when the package is published to the server. When pass SkipExtraFilesOnServer=true is translated to the msdeploy option -enableRule:DoNotDeleteRule. Which is applied (and relevant) when publishing to the package in your case. Now you need to ensure that option is set when the package is published to the server. That option is not embedded in the package in anyway.

这篇关于Web部署忽略SkipExtraFilesOnServer通过设定的MSBuild的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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