【问题标题】:Azure App Services - MVC5 WebApp missing css filesAzure 应用服务 - MVC5 WebApp 缺少 css 文件
【发布时间】:2018-12-26 15:41:53
【问题描述】:

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

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

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

    <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 帮助。

【问题讨论】:

    标签: azure azure-devops azure-web-app-service


    【解决方案1】:

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

    在调试模式下默认关闭。 你可以通过设置编译调试=“假”来打开它

    当您部署到 Azure 时,它​​会以启用捆绑的发布模式进行部署。 你可以阅读它here

    【讨论】:

    • 我会检查一下,因为这似乎是解决方案。据我所知,它与 Azure 无关。
    猜你喜欢
    • 2018-11-17
    • 1970-01-01
    • 1970-01-01
    • 2022-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-17
    相关资源
    最近更新 更多