I am trying to make sense of the nuget documentation. So I tried a naive:
<ItemGroup><Content Include="Data\Dict\*.json"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory><PackageCopyToOutput>true</PackageCopyToOutput><Pack>true</Pack><PackagePath>contentFiles\any\any\</PackagePath></Content></ItemGroup>
At least on my system it seems that *.json
files are being copied into a subfolder Data\Dict
. For example:
<snip>\bin\Debug\net7.0\Data\Dict\Dict1.json
But if I inspect the nupkg (7zip) I see that the *.json
files are now located directly under the folder:
<snip>.nupkg\contentFiles\any\any\Dict1.json
This makes loading/searching of those *.json files cumbersome. Is there a more natural way to include *.json files in C# and nupkg?