热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

避免删除WebPublish上的文件夹-AvoiddeletingfolderonWebPublish

ImdeployingmyapplicationtoanAzureWebsite.IveconfiguredthePublishingProfilesuccesfuly

I'm deploying my application to an Azure Website. I've configured the Publishing Profile succesfuly and setup tfspreview.com to publish automatically using continuous integration on each code commit.

我正在将我的应用程序部署到Azure网站。我已经成功配置了发布配置文件,并设置了tfspreview.com,以便在每次代码提交时使用持续集成自动发布。

I have a folder on the path "/media". This folder has pictures and documents uploaded through the CMS (umbraco). This folder gets deleted on each web deploy.

我在路径“/ media”上有一个文件夹。此文件夹包含通过CMS(umbraco)上传的图片和文档。每个Web部署都会删除此文件夹。

From this answer, I learned how to add a SkipDelete rule on either the .csproj or on the wpp.targets file, but everytime I publish the site the whole folder gets deleted anyway.

从这个答案,我学会了如何在.csproj或wpp.targets文件上添加SkipDelete规则,但每次我发布网站时,整个文件夹都会被删除。

Here is the code I'm currently using inside wpp.targets:

这是我目前在wpp.targets中使用的代码:



  AddCustomSkipRules






  
    Delete
    
    media
  




true

2 个解决方案

#1


2  

Is this not just an issue of unchecking the box in the publish wizard (settings step) that says "Delete all existing files prior to publish"? I know that option is available when setting up publishing from the Visual Studio side - it seems to me the Azure publishing credentials just give you the connection, and not the settings which you make through the wizard.

这不仅仅是取消选中发布向导(设置步骤)中“发布之前删除所有现有文件”框的问题吗?我知道在从Visual Studio端设置发布时可以使用该选项 - 在我看来,Azure发布凭据只是为您提供连接,而不是您通过向导进行的设置。

#2


1  

Looking over the question you are linking to and the code you have supplied above, it seems that you need to change the line:

查看您要链接的问题以及上面提供的代码,您似乎需要更改该行:

ErrorLog

to

media

as this refers to the folder you do not want to delete. ErrorLog was the folder the other question's author did not want to delete.

因为这指的是您不想删除的文件夹。 ErrorLog是另一个问题的作者不想删除的文件夹。


推荐阅读
author-avatar
我摸你马匹
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有