加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

Azure发布版本未显示捆绑包

发布时间:2020-12-16 07:01:44 所属栏目:asp.Net 来源:网络整理
导读:当我将调试版本发布到Azure时…我的所有样式文件都可以访问. 当我将我的发布版本发布到Azure上时……我的风格fies都无法访问. You do not have permission to view this directory or page. 在我的代码中,我有这样的包: bundles.Add(new StyleBundle("~/Con
当我将调试版本发布到Azure时…我的所有样式文件都可以访问.

当我将我的发布版本发布到Azure上时……我的风格fies都无法访问.

You do not have permission to view this directory or page.

在我的代码中,我有这样的包:

bundles.Add(new StyleBundle("~/Content/css").Include(
                  "~/Content/Packages/Bootstrap/src/bootstrap.css","~/Content/CSS/site.css","~/Content/CSS/bootstrap-theme-conflicts.css" ) );

在我的剃刀视图中,我有这个:

@Styles.Render( "~/Content/css" )

我的内容文件夹结构是:

已发布的申请中的最终网址是:

azurewebsites.net/Content/css/?v=i2nuaUMdmGVopZ-yRx75EKwl3vXByH5xgX4-uk0R9oE1

如果我直接去文件…即:

azurewebsites.net/Content/CSS/Site.css

他们很好.

有用的资源:

Bootstrap icons are loaded locally but not when online

解决方法

捆绑名称必须代表1级文件的真实目录…所以我添加了我的目录,然后在最后添加了word文件.单词文件然后成为文件名!

所以对于我的例子,我不得不拆开我的包:

bundles.Add(new StyleBundle("~/bundle/Packages/Bootstrap/src/files").Include(
                  "~/Content/Packages/Bootstrap/src/bootstrap.css"));

        bundles.Add(new StyleBundle("~/bundle/CSS/files").Include(
                  "~/Content/CSS/site.css","~/Content/CSS/bootstrap-theme-conflicts.css"));

然后在我的剃刀观点中,我改变了:

@Styles.Render("~/Content/Packages/Bootstrap/src/files")
@Styles.Render("~/Content/CSS/files")

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读