gpt4 book ai didi

Azure 应用服务 - MVC5 WebApp 缺少 css 文件

转载 作者:行者123 更新时间:2023-12-02 07:07:12 27 4
gpt4 key购买 nike

我计划迁移到 Azure Web 服务来托管我的 MVC5 Web 应用程序。我成功添加了与位于 AzureDevOps(以前称为 VSTS)上的 git 存储库的持续集成。 Azure 已提取我的存储库,我可以在 .azurewebsites.net 上看到我的网站,但没有我的 css 文件?当我查看源代码时,我可以看到不同的构建输出,就像我在本地主机中看到的那样(MS 定期构建和部署一切正常)。显然,Azure 我的所有 css 文件都添加到一行:

<link href="/Content/css?v=dO_Yd8KQtA539X-oIYSdv6BQQYt4J4R-RXerlkp23281" rel="stylesheet"/>

在我的本地主机中,Layout.cshtml 的 head 部分是:

    <link href="/Content/css/google-font.css" rel="stylesheet"/>
<link href="/Content/css/bootstrap.css" rel="stylesheet"/>
<link href="/Content/style.css" rel="stylesheet"/>
<link href="/Content/css/swiper.css" rel="stylesheet"/>
<link href="/Content/css/dark.css" rel="stylesheet"/>
<link href="/Content/css/font-icons.css" rel="stylesheet"/>
<link href="/Content/css/animate.css" rel="stylesheet"/>
<link href="/Content/css/magnific-popup.css" rel="stylesheet"/>
<link href="/Content/css/responsive.css" rel="stylesheet"/>

为什么 Azure 这样做?我使用的是 .NET Framework 4.6.1,而当我创建新的 Azure WebServices 时,我看到它是 4.7。然而,这不是这个问题的根源,对吧?由于我有免费试用版,因此无法联系 Azure 帮助。

最佳答案

您是否配置了捆绑和缩小?

Debug模式下默认关闭。您可以通过设置compilation debug="false"来打开它

当您部署到 Azure 时,它​​会以 Release模式部署,从而打开捆绑。你可以阅读here

关于Azure 应用服务 - MVC5 WebApp 缺少 css 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53934103/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com