[英]Using assemblies registered in Web.Config in files not in root folder
[英]Can there be multiple Web.Config files in root folder
我们可以通过保留单个web.config来配置特定文件夹中的网页设置。 可以在同一层次结构中存在多个web.config,就像我在web.config.debug和web.config.release以及web.config中看到的那样。 为什么他们的目的。
这些是web.config转换 ,允许您将更改应用于项目的不同构建(调试,开发,发布等)。
后缀为.debug
, .release
等的是转换文件。 它们使用基本web.config
并使用您指定的XML-Document-Transform属性对其进行修改。
一个经典的用例是debug=true
属性,您永远不想在生产中使用它。 您可以使用简单的转换将其删除到web.config.release
文件中:
Web.config文件
<configuration>
<compilation debug="true" />
</configuration>
Web.config.release
<configuration>
<compilation xdt:Transform="RemoveAttributes(debug)" />
</configuration>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.