title: How to exclude APP_DATA directory from publishing using custom target "PublishToFileSystem"
body: <p>I am using a custom target for publishing my web site to a local folder.</p>
  
  <p>The target (found <a href="https://stackoverflow.com/a/16246739/2115905">here</a>) looks like:</p>
  
  <pre><code>&lt;Target Name="PublishToFileSystem"
          DependsOnTargets="PipelinePreDeployCopyAllFilesToOneFolder"&gt;
      &lt;Error Condition="'$(PublishDestination)'==''"
             Text="The PublishDestination property must be set to the intended publishing destination." /&gt;
      &lt;MakeDir Condition="!Exists($(PublishDestination))"
               Directories="$(PublishDestination)" /&gt;
  
      &lt;ItemGroup&gt;
          &lt;PublishFiles Include="$(_PackageTempDir)\**\*.*" /&gt;
      &lt;/ItemGroup&gt;
  
      &lt;Copy SourceFiles="@(PublishFiles)"
            DestinationFiles="@(PublishFiles-&gt;'$(PublishDestination)\%(RecursiveDir)%(Filename)%(Extension)')"
            SkipUnchangedFiles="True" /&gt;
  &lt;/Target&gt;
  </code></pre>
  
  <p>The corresponding msbuild command looks like:</p>
  
  <pre><code>msbuild projectfile.csproj /p:DeployOnBuild=true /p:VisualStudioVersion=14.0 /p:configuration=Release /p:PublishDestination=C:\inetpub\wwwroot\WebSite /T:PublishToFileSystem
  </code></pre>
  
  <p>That works fine so far. However, I would like to exclude the APP_DATA directory from publishing. </p>
  
  <p>So, is there a way to exclude the APP_DATA directory from publishing? Maybe by excluding it from the file set defined with <code>&lt;PublishFiles Include="$(_PackageTempDir)\**\*.*" /&gt;</code>?</p>
  
  <p>Environment:
  Visual Studio 2015
  MSBuild Tools 2015</p>