【发布时间】:2011-04-07 23:30:39
【问题描述】:
有没有办法让主 .net 配置文件 app.config/web.config 包含另一个配置文件?我需要将内容保存在单独的文件中,但将它们链接在一起。
这是我想要包含的示例:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="LocationSearch.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<applicationSettings>
<LocationSearch.Properties.Settings>
<setting name="MapQuestApiKey" serializeAs="String">
<value>some value here...</value>
</setting>
<setting name="MapQuestClientCode" serializeAs="String">
<value>another value here...</value>
</setting>
</LocationSearch.Properties.Settings>
</applicationSettings>
</configuration>
【问题讨论】:
-
添加了我想要包含在主配置文件中的 XML 示例。
标签: .net configuration include