With the new .csproj
format (as well as the old), it is possible to add files as linked outside of the project folder:
<EmbeddedResource Include="..\..\..\Demo\Sample.cs" Link="Resources\Sample.cs" />
It is also possible to use a glob pattern to include multiple files:
<EmbeddedResource Include="..\..\..\Demo\*.cs" />
But how do you combine the two?
What I Tried
<EmbeddedResource Include="..\..\..\Demo\*.cs" Link="Resources\*.cs" />
<EmbeddedResource Include="..\..\..\Demo\*.cs" Link="Resources\*" />
<EmbeddedResource Include="..\..\..\Demo\*.cs" Link="Resources\" />
The first two only create a single linked file (with exactly the name *.cs
and *
respectively). The third simply errors out.
Is there a way to combine globbing with linked files to a specific location in the target project? If not, how can I link all the files in a directory without knowing how many or what their names are?