其他分享
首页 > 其他分享> > csproj文件设置输出到目录

csproj文件设置输出到目录

作者:互联网

发布或生成时将项目下的images文件夹和配置.json文件拷贝到输出目录,在项目文件中添加如下代码:
<ItemGroup>
  <Content Include="images\**">
    <CopyToPublishDirectory>Always</CopyToPublishDirectory>
    <CopyToOutputDirectory>Always</CopyToOutputDirectory>
  </Content>
</ItemGroup> <ItemGroup> <Content Include="配置.json"> <CopyToPublishDirectory>Always</CopyToPublishDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </Content> </ItemGroup>
CopyToPublishDirectory和CopyToOutputDirectory还有PreserveNewest(较新则复制).

标签:CopyToOutputDirectory,文件,csproj,输出,Always,目录
来源: https://www.cnblogs.com/gdpgdp317/p/15767245.html