title: CopyAllFilesToSingleFolderForPackageDependsOn and Web Deploy
body: <p>I am using Web Deploy feature of Visual Studio 2015 to deploy my Type Script SPA project to my staging server.</p>
  
  <p>I want the deployment process to copy (and rename) some deployment specific files from /Deployment folder of my project to other specific locations of the project.</p>
  
  <p>One such example is:</p>
  
  <p>[project_root]/Deployment/index.remote.debug.html ---> [project_root]/index.html</p>
  
  <p>I managed to achieve this using the following section in my publish profile (.pubxml):</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;Target Name="index_html"&gt;
    &lt;ItemGroup&gt;
      &lt;_CustomFiles Include="Deployment/index.remote.debug.html" /&gt;
      &lt;FilesForPackagingFromProject Include="%(_CustomFiles.Identity)"&gt;
        &lt;DestinationRelativePath&gt;index.html&lt;/DestinationRelativePath&gt;
      &lt;/FilesForPackagingFromProject&gt;
    &lt;/ItemGroup&gt;
  &lt;/Target&gt;
  &lt;Target Name="extractor_config"&gt;
    &lt;ItemGroup&gt;
      &lt;_CustomFiles Include="Deployment/extractor.config.remote.debug.js" /&gt;
      &lt;FilesForPackagingFromProject Include="%(_CustomFiles.Identity)"&gt;
        &lt;DestinationRelativePath&gt;extractor.config.js&lt;/DestinationRelativePath&gt;
      &lt;/FilesForPackagingFromProject&gt;
    &lt;/ItemGroup&gt;
  &lt;/Target&gt;
  
  &lt;PropertyGroup&gt;
    &lt;CopyAllFilesToSingleFolderForPackageDependsOn&gt;
      index_html;
      $(CopyAllFilesToSingleFolderForPackageDependsOn);
    &lt;/CopyAllFilesToSingleFolderForPackageDependsOn&gt;
    &lt;CopyAllFilesToSingleFolderForPackageDependsOn&gt;
      extractor_config;
      $(CopyAllFilesToSingleFolderForPackageDependsOn);
    &lt;/CopyAllFilesToSingleFolderForPackageDependsOn&gt;
  
  &lt;/PropertyGroup&gt;
  </code></pre>
  
  <p>But this works only when publishing to file system with 'File System' option.
  When publishing to my staging server using 'Web Deploy' option, I see no effect.
  The application is correctly deployed but respective files don't get copied/renamed.</p>
  
  <p>There is also no error message in Visual Studio output related to such a web deploy.</p>
  
  <p>It makes no difference if I deploy as non-admin or admin.</p>
  
  <p>Does anybody know, where is the problem?</p>
  
  <p>With respect to MSBuild I am a total layman and this is my first encounter. I've put this together only with help of other people's online experience.</p>