【问题标题】:Why does dotnet build not include folders when running release?为什么 dotnet build 在运行 release 时不包含文件夹?
【发布时间】:2020-11-02 21:22:34
【问题描述】:

我正在尝试在发布模式下构建 .net core 3 Web 应用程序,但已发布的源代码中缺少 wwwroot 和 ClientApp 文件夹。

我尝试将它们手动添加到 .csproj 中,如下所示,这些文件夹被包括在内,但其中没有任何内容。

有什么想法吗?

  <ItemGroup>
    <None Include="ClientApp\*" />
    <None Include="wwwroot\*" />
  </ItemGroup>

【问题讨论】:

    标签: asp.net-core .net-core asp.net-core-3.1


    【解决方案1】:

    您可以尝试使用** 通配符来包含这些文件夹中的所有内容。 documentation 声明:

    ** 通配符序列匹配部分路径。

    所以你的 ItemGroup 看起来像这样:

    <ItemGroup>
      <None Include="ClientApp\**" />
      <None Include="wwwroot\**" />
    </ItemGroup>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-06
      • 1970-01-01
      • 1970-01-01
      • 2018-01-22
      相关资源
      最近更新 更多