編譯時將指定檔案複製到輸出目錄
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<!--編譯時將新的appsettings.json複製到輸出目錄-->
<Content Include="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<!-- *********************************** -->
</ItemGroup>
</Project>
參考:
https://blog.darkthread.net/blog/dotnet-csproj-default-include/