如何禁用ASP.NET MVC 4 Beta版的JavaScript / CSS缩小 [英] How to disable Javascript/CSS minification in ASP.NET MVC 4 Beta

查看:179
本文介绍了如何禁用ASP.NET MVC 4 Beta版的JavaScript / CSS缩小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是尝试了ASP.NET MVC 4,但我无法弄清楚如何禁用的JavaScript / CSS缩小功能。特别是对于开发环境,这将大大有助于调试。我会想象它会在web.config中的开关,但由于ASP.NET MVC 4仍处于测试阶段,目前实在是没有太多的信息在那里。将AP preciate如果有人可以帮助或指向正确的博客文章等。

I am just trying out ASP.NET MVC 4 but I can't figure out how to disable Javascript/CSS minification feature. Especially for development environment this will help greatly on debugging. I would imagine it would be a switch in web.config but since ASP.NET MVC 4 is still in beta stage at the moment there's really not much information out there. Would appreciate if someone can help or point to the right blog posts etc.

推荐答案

在Global.asax.cs中

In Global.asax.cs

#if DEBUG
        foreach (var bundle in BundleTable.Bundles)
        {
            bundle.Transform = new NoTransform();
        }
#endif

这篇关于如何禁用ASP.NET MVC 4 Beta版的JavaScript / CSS缩小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆