自定义ConfigurationSection到外部.config

Ste*_*net 9 c# asp.net web-config

我知道有一种简单的方法可以将任何"标准"配置部分移动到外部文件,即

<appSettings file="myFile.config">
Run Code Online (Sandbox Code Playgroud)

但是自定义ConfigurationSection怎么样?

<configSections>
    <section name="someName" type="Namespace.SomeNameConfiguration" requirePermission="false" />
</configSections>

....

<someName>
  < bla bla bla ......
</someName>
Run Code Online (Sandbox Code Playgroud)

有没有类似的方法?

Joe*_*Joe 14

您可以使用

<somename configSource="myfile.config"/>

但与之不同appSettings file=...,您必须将整个部分放在外部文件中:没有合并.