我正在将我的应用程序部署到Azure网站.我已经配置succesfuly出版资料和设置tfspreview.com使用每个代码的持续集成提交自动发布.
我在路径"/ media"上有一个文件夹.此文件夹包含通过CMS(umbraco)上传的图片和文档.每个Web部署都会删除此文件夹.
从这个答案,我学会了如何在.csproj或wpp.targets文件上添加SkipDelete规则,但每次我发布网站时,整个文件夹都会被删除.
这是我目前在wpp.targets中使用的代码:
<PropertyGroup>
<AfterAddIisSettingAndFileContentsToSourceManifest>
AddCustomSkipRules
</AfterAddIisSettingAndFileContentsToSourceManifest>
</PropertyGroup>
<Target Name="AddCustomSkipRules">
<Message Text="Adding Custom Skip Rules" />
<ItemGroup>
<MsDeploySkipRules Include="SkipMediaFolder">
<SkipAction>Delete</SkipAction>
<ObjectName>filePath</ObjectName>
<AbsolutePath>media</AbsolutePath>
</MsDeploySkipRules>
</ItemGroup>
</Target>
<PropertyGroup>
<UseMsDeployExe>true</UseMsDeployExe>
</PropertyGroup>
Run Code Online (Sandbox Code Playgroud) 我正在尝试发布一个Web应用程序,但它在最后10分钟仍然停留在Adding ACL's for path.我不知道它为什么会卡在那里,我多次出版没有问题.
我将我的ASP.NET MVC应用程序托管为Azure云服务.
在新部署后,我在删除用户上传的图片时遇到问题.
上传的图片将保存到自定义特殊文件夹中 WebProject/UserFiles/MedicalCenterImages
下面我提供了我的项目文件夹结构.

我发现并调查了几个与我相关的问题
并且弄清楚,我应该在.csproj文件上添加一个SkipDelete规则.
<Target Name="AddCustomSkipRules">
<Message Text="Adding Custom Skip Rules" />
<ItemGroup>
<MsDeploySkipRules Include="SkipUserFilesFolder">
<SkipAction>Delete</SkipAction>
<ObjectName>filePath</ObjectName>
<AbsolutePath>UserFiles</AbsolutePath>
</MsDeploySkipRules>
</ItemGroup>
</Target>
Run Code Online (Sandbox Code Playgroud)
但我不完全明白我应该编辑哪个文件?(MaxPatient.Web.csproj或MaxPatientCloudService.ccproj或任何其他文件)
我总是发布我的MaxPatientCloudService项目.
我将不胜感激任何帮助.
谢谢 :)
我通过visual studio通过PublishProfile发布我的MVC项目(通过UI,右键单击项目,发布)并勾选清除目标文件夹的选项.但我不希望清除特定文件夹"下载"
我花了无数个小时试图完成这项工作,我想我的代码与此处解释的完全相同,但它仍然会删除"下载"文件夹
另外作为下面的示例,我有"favicon"的ExcludeFromPackageFiles,如果我取消选择目标文件夹的删除(只是为了表明我的wpp目标实际上正在运行).
下面是我的projectname.wpp.targets文件
<?xml version="1.0" encoding="utf-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- this doesnt work -->
<PropertyGroup>
<AfterAddIisSettingAndFileContentsToSourceManifest>AddCustomSkipRules</AfterAddIisSettingAndFileContentsToSourceManifest>
</PropertyGroup>
<PropertyGroup>
<UseMsDeployExe>true</UseMsDeployExe>
</PropertyGroup>
<Target Name="AddCustomSkipRules">
<Message Text="Adding Custom Skip Rules" />
<ItemGroup>
<MsDeploySkipRules Include="SkipErrorLogFolder1">
<SkipAction>Delete</SkipAction>
<ObjectName>filePath</ObjectName>
<AbsolutePath>ErrorLog</AbsolutePath>
</MsDeploySkipRules>
</ItemGroup>
</Target>
<!-- this works! -->
<ItemGroup>
<ExcludeFromPackageFiles Include="favicon.ico">
<FromTarget>ContactManager.Mvc.wpp.targets</FromTarget>
</ExcludeFromPackageFiles>
</ItemGroup>
</Project>
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
asp.net ×3
azure ×2
.net ×1
asp.net-mvc ×1
c# ×1
deployment ×1
msbuild ×1
umbraco ×1
webdeploy ×1