0

I have a issue in copying html files to deploy location using MSBuild.

Please help me in understanding the following:

<Target Name="CustomCollectFiles">
  <ItemGroup>
    <FilesForPackagingFromProject Include="@(CustomFilesToInclude)">
      <DestinationRelativePath>%(CustomFilesToInclude.Dir)\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
    </FilesForPackagingFromProject>
  </ItemGroup>
</Target>


<Target Name="CustomCollectFiles">
  <ItemGroup>
    <FilesForPackagingFromProject Include="@(CustomFilesToInclude)">
      <DestinationRelativePath>%(CustomFilesToInclude.Dir)\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
    </FilesForPackagingFromProject>
    <FilesForPackagingFromProject Include="@(CustomFilesToIncludeSkipExistingCheck)">
      <DestinationRelativePath>%(CustomFilesToIncludeSkipExistingCheck.Dir)\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
    </FilesForPackagingFromProject>
  </ItemGroup>
  <Error Text="Custom file exists in project files already: %(CustomFilesToInclude.FullPath)"
    Condition="Exists('$(MainProjectRootDir)\%(CustomFilesToInclude.Dir)\%(RecursiveDir)%(Filename)%(Extension)')" />
</Target>

<PropertyGroup>
  <CopyAllFilesToSingleFolderForPackageDependsOn>
    DefineCustomFiles;
    CustomCollectFiles;
    $(CopyAllFilesToSingleFolderForPackageDependsOn);
  </CopyAllFilesToSingleFolderForPackageDependsOn>
</PropertyGroup>
lucky
  • 27
  • 1
  • 1
  • 5
  • You only define the item groups and property groups, but never make the copy action. Then how do you imagine MSBuild to magically copy them for you? – Lex Li Mar 17 '14 at 05:50

1 Answers1

0

I've never used MSDeploy. But I'd say it just adds DestinationRelativePath metadata to item and injects targets DefineCustomFiles and CustomCollectFiles to be called before existing CopyAllFilesToSingleFolderForPackageDependsOn targets. I see it can be used by Microsoft.Web.Publishing.targets.

The code sample you've provided is not complete to say what's going on.

It looks like this: http://sedodream.com/2010/03/10/WebDeploymentToolIncludingOtherFiles.aspx

Palo Misik
  • 741
  • 3
  • 7