自定义的ConfigurationSection外部的.config [英] Custom ConfigurationSection to external .config

查看:188
本文介绍了自定义的ConfigurationSection外部的.config的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道有一个简单的方法来移动任何标准配置部分外部文件即。

I know there is an easy way to move any "standard" config section to external file i.e.

<appSettings file="myFile.config">

但对于一个自定义的ConfigurationSection?

but what about a custom ConfigurationSection?

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

....

<someName>
  < bla bla bla ......
</someName>

有没有类似的方式?

Is there any similar way?

斯特凡诺

推荐答案

您可以使用

&LT; somename configSource =myfile.config/&GT;

然而不同于文件的appSettings = ... ,你必须把整节在外部文件:没有合并

However unlike appSettings file=..., you must put the entire section in the external file: there is no merging.

这篇关于自定义的ConfigurationSection外部的.config的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆