title: Why is there a need for a separate item in my MSBuild file?
body: <p>There are many articles (like <a href="http://www.dotnetcatch.com/2016/07/20/include-extra-files-in-webdeploy-package/" rel="noreferrer">this</a> and <a href="https://github.com/sayedihashimi/publish-samples/blob/master/include-and-exclude-files.md" rel="noreferrer">this</a>) that show how to add files to be published, and they all say to add something like this to the publish profile (.pubxml):</p>
  
  <pre><code>&lt;Target Name="CustomCollectFiles"&gt;
    &lt;ItemGroup&gt;
      &lt;_CustomFiles Include="..\Extra Files\**\*" /&gt;
      &lt;FilesForPackagingFromProject  Include="%(_CustomFiles.Identity)"&gt;
        &lt;DestinationRelativePath&gt;Extra Files\%(RecursiveDir)%(Filename)%(Extension)&lt;/DestinationRelativePath&gt;
      &lt;/FilesForPackagingFromProject&gt;
    &lt;/ItemGroup&gt;
  &lt;/Target&gt;
  </code></pre>
  
  <p>Why is there a need for the new <code>_CustomFiles</code> item? Why not simply <code>&lt;FilesForPackagingFromProject Include="..\Extra Files\**\*"&gt;</code>? I tried it, and for some reason this causes every file in the project to end up in the deployed <code>Extra Files</code> folder. Can someone explain me this behaviour please?</p>