我debug="true"在我的web.config(s)中,我只是不希望我的捆綁縮小,但我沒做什么似乎禁用它。我試過了enableoptimisations=false,這是我的代碼://Javascriptbundles.Add(new ScriptBundle("~/bundles/MainJS") .Include("~/Scripts/regular/lib/mvc/jquery.validate.unobtrusive.js*") .Include("~/Scripts/regular/lib/mvc/jquery.validate*") .Include("~/Scripts/regular/lib/bootstrap.js") .IncludeDirectory("~/Scripts/regular/modules", "*.js", true) .IncludeDirectory("~/Scripts/regular/pages", "*.js", true) .IncludeDirectory("~/Scripts/regular/misc", "*.js", true));//CSSbundles.Add(new StyleBundle("~/bundles/MainCSS") .Include("~/Content/css/regular/lib/bootstrap.css*") .IncludeDirectory("~/Content/css/regular/modules", "*.css", true) .IncludeDirectory("~/Content/css/regular/pages", "*.css", true))
3 回答

青春有我
TA貢獻1784條經驗 獲得超8個贊
如果您debug="true"
在web.config中并且正在使用Scripts/Styles.Render
引用頁面中的包,那么應該關閉捆綁和縮小。BundleTable.EnableOptimizations = false
將始終關閉捆綁和縮小(無論調試真/假標志)。
你可能沒有使用Scripts/Styles.Render
助手嗎?如果您通過直接呈現對包的引用,BundleTable.Bundles.ResolveBundleUrl()
則始終會獲得縮小/捆綁的內容。

慕妹3146593
TA貢獻1820條經驗 獲得超9個贊
條件編譯指令是你的朋友:
#if DEBUG
var jsBundle = new Bundle("~/Scripts/js");
#else
var jsBundle = new ScriptBundle("~/Scripts/js");
#endif
- 3 回答
- 0 關注
- 625 瀏覽
添加回答
舉報
0/150
提交
取消