I am bundling and minifying my javascript files as shown below
bundles.Add(new ScriptBundle("~/bundles/CommunityMaintenance")
.Include(
"~/Scripts/Common.js",
"~/Scripts/AjaxEnhancers.js",
"~/Scripts/CommunityMaintenance.js",
"~/Scripts/TAR.js",
"~/Scripts/jquery.hotkeys-0.7.9.js"
));
ScriptManager.ScriptResourceMapping.AddDefinition(
"CommunityMaintenance",
new ScriptResourceDefinition
{
Path = "~/bundles/CommunityMaintenance"
});
However, when I need to turn it off using
System.Web.Optimization.BundleTable.EnableOptimizations = false;
This does not work. I have registered my bundles in the Application_Start method in Global.asax and am disabling optimization in the very next line. I have even set the debug to true but it makes no difference. What am I doing wrong?