【问题标题】:.Net core bower_components folder missing in wwwroot directorywwwroot 目录中缺少 .Net 核心 bower_components 文件夹
【发布时间】:2021-03-02 18:26:55
【问题描述】:

我有新鲜的 .Net 核心网络应用程序,它的源代码第一次上传到生产服务器上,CICD 相同。它成功了,但是当我运行 Web 应用程序时,UI 和 js 文件丢失了。经过大量挖掘,我发现 bower_component 文件夹丢失了,其中包括 wwwroot 文件夹中必要的 css 和 js 文件。

谁能告诉我为什么它没有将 bower_components 上传到 wwwroot 文件夹?

【问题讨论】:

  • 如果我的解决方案对您有帮助,请您将我的答案标记为accepted,tks~
  • 除此之外,您提到这是一个全新的 ASP.NET Core Web 应用程序,而且它使用的是 Bower。你应该知道Bower is deprecated。您应该更喜欢使用例如使用 WebPack 制作纱线。

标签: azure-web-app-service bower asp.net-core-3.1


【解决方案1】:

您需要修改您的.csproj 文件以包含bower_component 文件夹。

您可以先阅读官方文档(Include files at publish time),然后您可以参考下面的帖子。

相关帖子(包括文件,不是文件夹)可以参考:

1. Unable to find files located in my root project folder when hosted on Azure

2. .NET Core include folder in publish

3. How to copy a folder to output directory and keep its root folder? #2949

4. dotnet core publish: include/exclude dir in output

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-02-01
    • 1970-01-01
    • 2015-03-17
    • 1970-01-01
    • 2017-10-06
    • 2021-10-19
    • 2017-09-08
    相关资源
    最近更新 更多