C# MVC 5 bundles.ignoreList.Clear不工作
我将MVC4升级到MVC5,现在所有以C# MVC 5 bundles.ignoreList.Clear不工作,c#,asp.net,asp.net-mvc,asp.net-mvc-5,C#,Asp.net,Asp.net Mvc,Asp.net Mvc 5,我将MVC4升级到MVC5,现在所有以.min或.debug结尾的文件都不包括在包中。在MVC4中,bundles.IgnoreList.Clear()有帮助,但不再有效 public static void RegisterBundles(BundleCollection bundles) { bundles.IgnoreList.Clear(); bundles.Add(new ScriptBundle("~/bundles/librar
.min
或.debug
结尾的文件都不包括在包中。在MVC4中,bundles.IgnoreList.Clear()代码>有帮助,但不再有效
public static void RegisterBundles(BundleCollection bundles) {
bundles.IgnoreList.Clear();
bundles.Add(new ScriptBundle("~/bundles/library")
.IncludeDirectory("~/Scripts/Libraries", "*.js", true));
}
如何在MVC5中不忽略我的.min
和.debug
文件?似乎无法将文件.min.js
包含到包中。但是file-min.js
,file debug.js
和file.debug.js
仍然有效
看到这个了吗
注意:项目使用包:
启用了EnableOptimizations之后,当我的脚本包停止显示时,我认为我的问题是忽略列表,并花了一个小时试图修复我的缩小文件名等。然而,我的问题是我使用的捆绑包名称,其中包含“.”
例如,改变
new ScriptBundle("~/bundles/root1.0ThirdParty")
到
为我修复了这个问题,即使包含中的缩小文件也能正常工作。是file-min.js
还是file.min.js
?抱歉,是file.min.js。请重命名:)看到了吗
new ScriptBundle("~/bundles/root10ThirdParty")