【发布时间】:2015-06-03 08:36:11
【问题描述】:
当使用内置模板(文件 -> 新项目等)创建 MVC 项目时,web.config 会读取
<compilation debug="true" targetFramework="4.5" />
在 Web.Release.config 中我看到了这个转换
<compilation xdt:Transform="RemoveAttributes(debug)" />
所以我假设当我在发布模式下构建时 debug="true" 会消失。但是我没有看到这个。 转换是否仅在发布网站时应用?我见过通过拖放部署的网站,Web.config 从根目录复制过来(包括 debug="true")。
我想检查一下,如果通过拖放进行部署,您是否必须手动删除此属性?还是我错过了什么?
【问题讨论】:
-
xdt:Transform="RemoveAttributes(debug)" 属性指定您希望从部署的 Web.config 文件中的 system.web/compilation 元素中删除调试属性。每次部署发布版本时都会执行此操作。
-
回答了您的问题?
标签: asp.net-mvc web-config web-deployment