asp.net – 单独配置文件为web.config的部分

前端之家收集整理的这篇文章主要介绍了asp.net – 单独配置文件为web.config的部分前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
是否可以为web.config的特定部分分别配置文件?具体来说,我想将IIS 7的重写部分从web.config中移动到自己的配置文件中。

解决方法

您可以将重写规则和映射移动到单独的文件中:

07000

  1. <system.webServer>
  2. <rewrite>
  3. <rewriteMaps configSource="rewritemaps.config" />
  4. <rules configSource="rewriteRules.config" />
  5. </rewrite>
  6. </system.webServer>@H_301_11@
  7. 此外,您可以将不少配置部分移动到自己的文件中:

  8. <appSettings configSource="appSettings.config" /> 07001

  9. <connectionStrings configSource="connectionStrings.config"/> 07002

  10. <pages configSource="pages.config"/> 07003

  11. 有关更多信息,请参阅此页面,这将帮助您确定配置部分是否可以从外部存储:

  12. 07004

猜你在找的asp.Net相关文章