views:

441

answers:

2

Hi,

Is there any possiblity to read a .config file in a dll assembly? At the moment I use OpenExeConfiguration on a Assembly.Location Property which seems to work. But I want to create separate .config files for different usages like ConfigModuleA.config, ConfigModuleB.config etc.

Any idea?

+1  A: 

Are you wanting to read another applications config file or just have some sections of the config file in a separate file (say, to make it more managable)?

If the latter just provide a configSource attribute on the config section you want to put somewhere else.

See - http://msdn.microsoft.com/en-us/library/ms228167.aspx

Slace
The "basic" appliation will be separated into two dlls and the executable. I need to put a config file in one of the dlls that can be loaded from a function in the second dll. Experimented with configSoure but did't find a proper solution so far.
Haiko Wick
A: 

Ok, I simplified it a lot. I stored the configuration data in simple structured xml files and embedded them to the dll. Now I can use the XML serialisation to read the configuration from the dll without any stress.

Thx for the answer!

Haiko Wick