<ItemGroup>
<Folder Include="$(SolutionDir)config\" CopyToOutputDirectory="Always" />
</ItemGroup>
It didn't work, what's the correct way to copy a folder to output/publish dir?
Sounds like a question for the Microsoft/MSBuild repo. @andygerlicher or @rainersigwald any ideas?
MSBuild doesn't have a built-in concept for this. There are two usual approaches:
<ItemGroup>
<None Include="$(SolutionDir)config\**" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
Thanks @rainersigwald !
Thank you for pointing the way & answering.
@rainersigwald I have folder "resources" in my solution folder. This folder contains many other folder and files. I want only this content to be in my output folder (not the folder "resources" itself). I used your solution and add this lines to project file:
<ItemGroup>
<None Include="$(SolutionDir)resources\**" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
But I get folder "resources" with all its content in my output folder. So all paths to files in app is broken. How to copy only content of specific folder to output folder?
(VS Community 2017 v 15.7.3)
@vrd https://github.com/Microsoft/msbuild/issues/2949#issuecomment-362824225 This might helps you.
Most helpful comment
MSBuild doesn't have a built-in concept for this. There are two usual approaches: