title: How to stop MSBuild _WPPCopyWebApplication target cleaning App_Data folder
body: <p>I'm using the _WPPCopyWebApplication MSBuild target in a CruiseControl.net build-and-deploy script, but it appears that this target cleans files not part of the project before the deployment - specifically, App_Data files (which for this app, include uploaded images, etc).</p>
  
  <p>From Microsoft.Web.Publishing.targets;</p>
  
  <pre><code>&lt;OnBefore_WPPCopyWebApplication&gt;
      $(OnBefore_WPPCopyWebApplication);
      CleanWebProjectOutputDir;
      PipelineTransformPhase;
  &lt;/OnBefore_WPPCopyWebApplication&gt;
  </code></pre>
  
  <p>How can I stop it doing the CleanWebProjectOutputDir, given this target;</p>
  
  <pre><code>&lt;Target Name="Deploy" DependsOnTargets="Tests"&gt;
      &lt;MSBuild Projects="$(TargetPath)Website.csproj" Properties="Configuration=Debug;WebProjectOutputDir=\\servername\share;Outdir=$(ProjectDir)bin\;" Targets="ResolveReferences;_WPPCopyWebApplication" /&gt;
  &lt;/Target&gt;
  </code></pre>
  
  <p>This is from a VS2010 solution, albeit built under CC.Net; I'm aware of MSDeploy, but haven't got my head around that fully yet, so would prefer to stick with MSBuild/_WPPCopyWebApplication for now.</p>
  
  <p>EDIT:</p>
  
  <p>I've further narrowed this to this part of the target;</p>
  
  <pre><code>&lt;!-- In the case of the incremental Packaging/Publish, we need to find out the extra file and delee them--&gt;
  &lt;ItemGroup&gt;
      &lt;_AllExtraFilesUnderProjectOuputFolder Include="$(WebProjectOutputDir)\**" /&gt;
      &lt;_AllExtraFilesUnderProjectOuputFolder Remove="@(FilesForPackagingFromProject-&gt;'$(WebProjectOutputDir)\%(DestinationRelativePath)')" /&gt;
  &lt;/ItemGroup&gt;
  &lt;!--Remove all extra files in the temp folder that's not in the @(FilesForPackagingFromProject--&gt;
  &lt;Delete Files="@(_AllExtraFilesUnderProjectOuputFolder)" /&gt;
  </code></pre>
  
  <p>So I guess the question becomes, how can I supress this specific Delete task, or at least add App_Data** to the _AllExtraFilesUnderProjectOuputFolder exclusions?</p>