App.Config Exchange Library

I have a DLL, for the Dll to work, some configurations are needed, mainly for WCF.

im using this dll in multiple applications, how can i combine this app.config dll into app.config applications?

Thanks.

+4
source share
2 answers

In your dll application configuration, you will need to copy two parts. Paste them into the app.config application file.

First you need an ad next to the top. Most likely, you will need to merge them into existing configuration sections for your application.

<configuration> <configSections> <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <section name="MyApplication.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> </sectionGroup> </configSections> 

Then you have the actual configuration section at the same level as configSections

 <applicationSettings> <MyApplication.Settings> <setting name="Setting1" serializeAs="String"> <value>hello world</value> </setting> <setting name="Setting2" serializeAs="String"> <value>This is my value!</value> </setting> </MyApplication.Settings> </applicationSettings> 

The application configuration for the executable application will automatically replace your dll app.config.

+4
source

CodeProject has a good article on this topic: http://www.codeproject.com/KB/dotnet/dllappconfig.aspx

0
source

All Articles