在我看来喜欢在debug模式下查看site.css使用她,而在release模式下编译查看时使用css-min.css site。
像这样:
# if (Debug)
/ / CSS
# elif (Release)
/ / CSS Min-
# endif
但在我看来.cshtml
最佳答案
您可以使用 Context.IsDebuggingEnabled
。此 bool 属性由 web.config 中编译部分的调试属性控制。
这是您的 view.cshtml 示例:
if (Context.IsDebuggingEnabled)
{
// use something.css
}
else
{
// use something.min.css
}
关于asp.net-mvc-3 - Site.css 为 Debug模式,site-min.css 为 Release模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7522840/