App.config文件出错,配置系统未能初始化。

如果配置文件中包含 configSections 元素,则 configSections 元素必须是 configuration 元素的第一个子元素。将appSettings放到configSections 后,则正常。

 

configSections中的元素必须和下面的自定义配置节一一对应。

例如 下面有4个自定义配置节,但是在configSections只有3个,就会出错:配置系统未能初始化。

<configSections>
   <section name="A_F63_Structure" type="A_F63_StructureHandler,PkgBuilder" />
   <section name="A_F10_Structure" type="A_F10_StructureHandler,PkgBuilder" />
   <section name="A_F11_Structure" type="A_F11_StructureHandler,PkgBuilder" />
</configSections>

<C_F10_Structure>

</C_F10_Structure>

<A_F63_Structure>

</A_F63_Structure>

<A_F10_Structure>

</A_F10_Structure>

<A_F11_Structure>

</A_F11_Structure>

原文地址:https://www.cnblogs.com/edong/p/1793301.html