Deployment 如何停止MSBuild _WPPCopyWebApplication目标清理应用程序_数据文件夹

Deployment 如何停止MSBuild _WPPCopyWebApplication目标清理应用程序_数据文件夹,deployment,msbuild,cruisecontrol.net,Deployment,Msbuild,Cruisecontrol.net,我在CruiseControl.net生成和部署脚本中使用了_wppcopyWebApplicationMSBuild目标,但该目标似乎会在部署之前清理不属于项目一部分的文件,具体来说,是App_数据文件(对于此应用,包括上载的图像等) 从Microsoft.Web.Publishing.targets <OnBefore_WPPCopyWebApplication> $(OnBefore_WPPCopyWebApplication); CleanWebProject

我在CruiseControl.net生成和部署脚本中使用了_wppcopyWebApplicationMSBuild目标,但该目标似乎会在部署之前清理不属于项目一部分的文件,具体来说,是App_数据文件(对于此应用,包括上载的图像等)

从Microsoft.Web.Publishing.targets

<OnBefore_WPPCopyWebApplication>
    $(OnBefore_WPPCopyWebApplication);
    CleanWebProjectOutputDir;
    PipelineTransformPhase;
</OnBefore_WPPCopyWebApplication>

$(OnBeforewppcopyWebApplication);
CleanWebProjectOutputDir;
管道相;
鉴于这个目标,我如何阻止它执行CleanWebProjectOutputDir

<Target Name="Deploy" DependsOnTargets="Tests">
    <MSBuild Projects="$(TargetPath)Website.csproj" Properties="Configuration=Debug;WebProjectOutputDir=\\servername\share;Outdir=$(ProjectDir)bin\;" Targets="ResolveReferences;_WPPCopyWebApplication" />
</Target>

这来自VS2010解决方案,尽管它是在CC.Net下构建的;我知道MSDeploy,但还没有完全了解它,所以现在我更愿意使用MSBuild/_WPPCopyWebApplication

编辑:

我已经进一步缩小到目标的这一部分

<!-- In the case of the incremental Packaging/Publish, we need to find out the extra file and delee them-->
<ItemGroup>
    <_AllExtraFilesUnderProjectOuputFolder Include="$(WebProjectOutputDir)\**" />
    <_AllExtraFilesUnderProjectOuputFolder Remove="@(FilesForPackagingFromProject->'$(WebProjectOutputDir)\%(DestinationRelativePath)')" />
</ItemGroup>
<!--Remove all extra files in the temp folder that's not in the @(FilesForPackagingFromProject-->
<Delete Files="@(_AllExtraFilesUnderProjectOuputFolder)" />


因此,我想问题是,我如何才能禁止这个特定的删除任务,或者至少将App_Data**添加到_allextrafilesnowprojectoutputfolderexclusions?

CleanWebProjectOutputDir=False
添加到您的属性:

<Target Name="Deploy" DependsOnTargets="Tests">
    <MSBuild Projects="$(TargetPath)Website.csproj" Properties="Configuration=Debug;CleanWebProjectOutputDir=False;WebProjectOutputDir=\\servername\share;Outdir=$(ProjectDir)bin\;" Targets="ResolveReferences;_WPPCopyWebApplication" />
</Target>

天哪,我已经找这个属性很久了,你知道在哪里可以找到msbuild属性列表吗?