尝试这个:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="WindowsFormsApplication1.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
<sectionGroup name="librarySettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="ClassLibrary1.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<applicationSettings>
<WindowsFormsApplication1.Properties.Settings>
<setting name="HostSetting" serializeAs="String">
<value>Foo</value>
</setting>
</WindowsFormsApplication1.Properties.Settings>
</applicationSettings>
<librarySettings>
<ClassLibrary1.Properties.Settings>
<setting name="LibrarySetting" serializeAs="String">
<value>Bar</value>
</setting>
</ClassLibrary1.Properties.Settings>
</librarySettings>
</configuration>
这会在您的主机应用程序的应用程序配置中创建两个部分组。一个用于主机本身的设置,另一个用于您的库中定义的设置。