首页 > 解决方案 > 在 MS Build 中复制到输出时如何保留文件夹?

问题描述

这是我的代码:

    <ItemGroup>
      <Content Include="$(ProjectDir)..\Translations\**\*.*">
         <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      </Content>
    </ItemGroup>

基本上我告诉项目继续文件夹,并将文件Translations的所有内容复制到输出目录。

但是,当我转到输出时,我看到没有Translations目录。只有它的文件被直接复制到bin文件夹中。

我想要的是也保留该Translations文件夹。换句话说,文件应该被复制到bin\Translations目录中。

我应该怎么做才能得到这个结果?

标签: .net-coremsbuild

解决方案


推荐阅读