試試這個:
<?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>
這在你的主機應用程序的應用程序配置創建兩個節組。一個用於主機本身的設置,另一個用於庫中定義的設置。