C# web.config中的自定义标记

C# web.config中的自定义标记,c#,web-config,configuration-files,custom-tags,C#,Web Config,Configuration Files,Custom Tags,我已使用如下配置文件在web.config文件中创建了自定义标记: <ParentTag> <ChildTag> <add param1="some value" param2="some value" param3="some value /> <add param1="some other value" param2="some other value" param3="some other value">

我已使用如下配置文件在web.config文件中创建了自定义标记:

<ParentTag>
    <ChildTag>
        <add param1="some value" param2="some value" param3="some value />
        <add param1="some other value" param2="some other value" param3="some other value">
    </ChildTag>
<ParentTag>


按提要项使用ConfigurationElementCollection,如示例中所述

public class FeedElementCollection : ConfigurationElementCollection

按提要项使用ConfigurationElementCollection,如示例中所述

public class FeedElementCollection : ConfigurationElementCollection

有什么特别的原因不只是使用这个部分吗?嗯,看起来您想在配置部分中创建集合集合。你可以这样做。但它看起来会很奇怪。@MaKCbIMKo它可能看起来很奇怪,但我可以证明这样的结构是有用的。这一切都将取决于你如何命名事物,以及它看起来有多奇怪。@Hill你在
appSettings
上没有获得Intellisense支持。而且你不能将
appSettings
用于自定义类型AFAIKIs。你有什么特别的原因不只是使用该部分吗,看起来您希望在配置部分中创建集合集合。你可以这样做。但它看起来会很奇怪。@MaKCbIMKo它可能看起来很奇怪,但我可以证明这样的结构是有用的。这一切都将取决于你如何命名事物,以及它看起来有多奇怪。@Hill你在
appSettings
上没有Intellisense支持。而且你不能对自定义类型使用
appSettings