I want to copy one folder which contains subfolders to another location using MSBuild. I am doing this the following way:
<ItemGroup>
<FilesToCopy Include="C:\SomePath\**\*.*"/>
</ItemGroup>
<Copy OverwriteReadOnlyFiles="true"
ContinueOnError="false"
SourceFiles="@(FilesToCopy)"
DestinationFolder="$(ResourcesPath)\%(RecursiveDir)%(Filename)%(Extension)" />
And this approach works if subfolder contains files. But if some subfolder does not contain any file - it is not copied. Therefore question - how can I copy all the subfolders of some folder using MsBuild?