.net 如何在其自己的文件中使用自定义配置节?
过去,我在app.config文件中创建了自定义配置节。如何将ConfigurationSection移动到它自己的文件中,独立于我的应用程序的主配置文件?在app.config文件中执行此操作.net 如何在其自己的文件中使用自定义配置节?,.net,.net-4.5,.net,.net 4.5,过去,我在app.config文件中创建了自定义配置节。如何将ConfigurationSection移动到它自己的文件中,独立于我的应用程序的主配置文件?在app.config文件中执行此操作 <configuration> <configSections> <section name="customSection" type="ABC" /> </configSections> <customSection c
<configuration>
<configSections>
<section name="customSection" type="ABC" />
</configSections>
<customSection configSource="custom.config"></customSection> //Your own file name is the configSource
//您自己的文件名是configSource
创建另一个名为custom.config的文件。在该文件中:
<customSection>
//Your config here
</customSection>
//你的配置在这里