【发布时间】:2010-04-12 15:24:27
【问题描述】:
对于 web.config 的 system.web/httpHandlers 部分,我可以使用“configSource”属性来指定外部配置文件,如下所示:
<system.web>
<httpHandlers configSource="App_Config\httpHandlers_iis6.config" />
</system.web>
这允许我在所有环境中使用相同的处理程序集,而只需将它们维护在一个地方,同时仍允许 appSettings 等内容从一个 web.config 更改为下一个。
不幸的是,与 IIS7 处理程序有关的部分似乎不支持相同的技术:
<system.webServer>
<handlers configSource="App_Config\httpHandlers_iis7.config" /> <!-- not supported -->
</system.webServer>
有什么方法可以将我的处理程序配置与 IIS7 的主 web.config 文件分开?
【问题讨论】:
-
我也想知道这个。虽然原因有点不同。我想要一个用于 64 位 IIS7.5 的部分,一个用于 IIS7.5 32 位的部分。
标签: asp.net iis-7 web-config