C# 将新捆绑包添加到捆绑包配置
在我的C# 将新捆绑包添加到捆绑包配置,c#,asp.net-mvc,razor,bundle,C#,Asp.net Mvc,Razor,Bundle,在我的\u布局页面中,我有以下脚本: @Scripts.Render("~/Scripts/Scripts.js") @Scripts.Render("~/Scripts/moment-with-locales.js") @Scripts.Render("~/Scripts/moment.js") @Scripts.Render("~/Scripts/bootstrap-datetimepicker.js") @Scripts.Render("~/Scripts/DayPilot/daypilo
\u布局
页面中,我有以下脚本:
@Scripts.Render("~/Scripts/Scripts.js")
@Scripts.Render("~/Scripts/moment-with-locales.js")
@Scripts.Render("~/Scripts/moment.js")
@Scripts.Render("~/Scripts/bootstrap-datetimepicker.js")
@Scripts.Render("~/Scripts/DayPilot/daypilot-all.min.js")
因此,我不想把所有这些都写出来,而是想创建一个包:
bundles.Add(new ScriptBundle("~/bundles/otherScripts").Include(
"~/Scripts/Scripts.js",
"~/Scripts/moment-with-locales.js",
"~/Scripts/moment.js",
"~/Scripts/bootstrap-datetimepicker.js",
"~/Scripts/DayPilot/daypilot-all.min.js",
"~/Scripts/DayPilot/daypilot-common.src.js"));
因此,现在在我的\u布局
页面中,我有以下内容:
@Scripts.Render("~/bundles/otherScripts")
现在在我的bootstrap datetimepicker.js
中,我编辑了一行。。当我在本地测试这个应用程序时,这个变化会直观地显示出来。。但是当我发表的时候。。我换的那行不行
唯一可行的方法是我从bundle中排除bootstrap datetimepicker.js
文件,并在\u布局
页面中引用它
如何将所有这些脚本合并到捆绑包中,并在发布时正常工作?您是否验证了这不是缓存的问题(即,硬刷新/以匿名方式打开)?每次退出IE时,我都会清除缓存。。我也在Chrome上测试过,同样的问题应用程序运行你的应用程序,在浏览器中打开页面并检查元素。您是否在页面上看到了
捆绑包/其他脚本的包含?@EugeneKomisarenko是的,我看到了:
当您在浏览器中打开此脚本的源代码时,您是否看到了要查找的模块?