How to stop MSBuild _WPPCopyWebApplication to clean the App_Data folder

I use the _WPPCopyWebApplication MSBuild target in creating and deploying the CruiseControl.net script, but it seems that this target clears files that are not part of the project before deployment - in particular, the App_Data files (which the application for this, including downloaded images, etc. )

From Microsoft.Web.Publishing.targets;

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

How can I stop its execution of CleanWebProjectOutputDir, given this goal,

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

This solution is VS2010, although it is built under CC.Net; I know MSDeploy, but I don’t know yet how to do this, so now prefer to use MSBuild / _WPPCopyWebApplication.

EDIT:

I have narrowed it down to this part of the goal;

 <!-- 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 not in the @(FilesForPackagingFromProject--> <Delete Files="@(_AllExtraFilesUnderProjectOuputFolder)" /> 

So, I think, the question arises, how can I suppress this particular uninstall task, or at least add App_Data ** to _AllExtraFilesUnderProjectOuputFolder exceptions?

+8
deployment msbuild
source share
1 answer

Add CleanWebProjectOutputDir=False to your properties:

 <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> 
+9
source share

All Articles