我有这个网站.配置文件,编译选项设置如下
Web.config
<configuration>
...
<system.web>
<compilation debug="true" targetFramework="4.5" />
...
</system.web>
</configuration>
下面是VisualStudio默认设置为发布模式的内容.
Web.Release.config个
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<system.web>
<compilation xdt:Transform="RemoveAttributes(debug)" />
</system.web>
</configuration>
我正在为MVC4项目使用这个.基于this tutorial,我预计当应用程序在Release Mode下运行时,会提供js和css的精简版本.但这似乎并不管用,而且正在提供js和css的非缩小版本.另一方面,如果我在web.config中将debug显式设置为false,则最小版本将被正确提供.
当应用程序在Release Mode下运行时,看起来像是compilation位标签转换问题,但我不明白在Web上这样做有什么问题.释放配置.
简而言之,我无法通过在Release Mode以下运行应用程序来实现Bundle 和缩小.