【发布时间】:2024-05-03 22:55:02
【问题描述】:
我已通过以下文章工作。
http://www.jokecamp.com/blog/net-custom-configuration-section-collection-and-elements/
如果我确实喜欢它所说的,我可以实现。但我想删除父节点。我希望 xml 如下所示。
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="jobSection"
type="MyConfiguration.JobSection, MyConfiguration" />
</configSections>
<jobSection>
<job id="1" name="Job Name A" />
<job id="2" name="Job Name B" />
</jobSection>
</configuration>
如果 xml 像上面那样,我会收到错误 Unrecognized element 'job'.。
如何通过上面的 xml 定义自定义部分?
【问题讨论】:
标签: c# web-config app-config configurationmanager custom-sections