I'm trying to have the contents of a folder copied to build output. Ideally under the same path relative to the output/publish folder. I have:
<!-- front-end files to serve -->
<ItemGroup>
<Folder Include="Frontend\Content">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Folder>
</ItemGroup>
However, when I use dotnet publish, no file is copied.
This works for the config file I want - this was generated by VS:
<ItemGroup>
<None Remove="my-config.json" />
</ItemGroup>
<ItemGroup>
<Content Include="my-config.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
So my question is - what is this craziness? Semantically, an element called None with a Remove attribute - what does that even mean?
My vague intuition is that the element is equivalent to a "set", the contents of which will be actioned based on the name of that element/set, and that Include, Exclude, Remove somehow(?) interact to define and refine the contents of that set.
But then - what's "Folder"? What's "Content"? What happens when things double-up: why is the "None/Remove" combo needed? If it is at all - that was generated by VS!
Documentation-wise, I found:
https://docs.microsoft.com/en-us/dotnet/core/tools/csproj#how-to-see-the-whole-project-as-msbuild-sees-it, which talks about Compile, EmbeddedResource and None default globs (Include, Exclude and Remove globs). I know what a glob is, I know what those actions mean, but what are those types of globs? How do they interact?
It also points to MSBuild documentation at https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild-project-file-schema-reference?view=vs-2017, but that seems useless for this: it doesn't document None, EmbeddedResource, or Compile elements shown, nor does it talk about the Content and Folder elements I've found in other examples (and generated by VS).
In fact, nothing I've found yet talks about what this all means.
Where can I find documentation for this?