Haiko Wick
Haiko Wick

Reputation: 417

Read .config file in another assembly

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?

Upvotes: 0

Views: 1034

Answers (2)

Haiko Wick
Haiko Wick

Reputation: 417

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!

Upvotes: 0

Aaron Powell
Aaron Powell

Reputation: 25099

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

Upvotes: 1

Related Questions