Take the 2-minute tour ×

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?

share|improve this question
add comment

2 Answers

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

share|improve this answer
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 Dec 23 '08 at 10:16
add comment
up vote 0 down vote accepted

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!

share|improve this answer
add comment

Your Answer


