C# 捆绑不在生产中工作
以下是用于捆绑的mu代码片段:C# 捆绑不在生产中工作,c#,asp.net-mvc,bundle,C#,Asp.net Mvc,Bundle,以下是用于捆绑的mu代码片段: bundles.Add(new StyleBundle("~/bundles/scent-css").Include( "~/css/bootstrap.css", "~/css/custom.css")); 在我的布局中,我使用以下方法添加css文件: @style.Render(“~/bundles/scss”) 在我的机器上一切正常,但当我将所有内容移动到本地web服务器(IIS)时,css文件
bundles.Add(new StyleBundle("~/bundles/scent-css").Include(
"~/css/bootstrap.css",
"~/css/custom.css"));
在我的布局中,我使用以下方法添加css文件:
@style.Render(“~/bundles/scss”)
在我的机器上一切正常,但当我将所有内容移动到本地web服务器(IIS)时,css文件无法加载。如果我在生产环境中查看页面的源代码,我可以看到行:
<link href="/bundles/scent-css?v=v4ohyWx_1204EYiKV1yo4Pyg03bErnO8heg7POAEXP01" rel="stylesheet"/>
我已经在谷歌上搜索了这一点,尝试了几乎所有人们建议的方法,到目前为止,没有一种方法有效
我试过:
-添加bundles.IgnoreList.Clear()在BundleConfig中
-编辑添加的网络配置:
<modules runAllManagedModulesForAllRequests="true">
<remove name="BundleModule" />
<add name="BundleModule" type="System.Web.Optimization.BundleModule" />
你知道我在这里做错了什么,为什么css文件没有加载吗
谢谢设法修好了:你是怎么修好的?我也有同样的问题。解决方案: