【发布时间】:2011-05-25 23:47:01
【问题描述】:
我在 CruiseControl.net 构建和部署脚本中使用 _WPPCopyWebApplication MSBuild 目标,但似乎该目标在部署之前清理了不属于项目的文件 - 特别是 App_Data 文件(对于这个应用程序,包括上传的图片等)。
来自 Microsoft.Web.Publishing.targets;
<OnBefore_WPPCopyWebApplication>
$(OnBefore_WPPCopyWebApplication);
CleanWebProjectOutputDir;
PipelineTransformPhase;
</OnBefore_WPPCopyWebApplication>
鉴于此目标,我如何才能阻止它执行 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** 添加到 _AllExtraFilesUnderProjectOuputFolder 排除项?
【问题讨论】:
标签: deployment msbuild cruisecontrol.net