ConfigurationManager Module Settings

Topics: Prism v4 - WPF 4
Nov 24, 2011 at 9:32 AM

Hi,

I am developping a modular application using Prism and I want each module to have some specific settings. I searched on the net for this common issue but I didn't find a "clear" solution.

I was thinking of two ways to do it:

- In the intialize fonction of each module, read a section (GetSection) of the app.config file using the ConfigurationManager class. The only thing that bothers me with this approach is: when a new module is added to the application, the configuration file should be changed in order to add a new section. It doesn't seem as flexible as it should be.

-Have a separate configuration file for each module and read it using the ConfigurationManager.OpenExeConfiguration method. Thus, when a new module is deployed, it comes with its configuration file (same name as the module).

I have a preference for the second approach but it may not be the good one.

What are your thoughts on all this?

Thanks,

Best,

Developer
Nov 24, 2011 at 12:20 PM

Hi,

Considering your requirements, I don't see anything wrong with the second approach you're mentioning. I believe you could use it if it suits your scenario.

I hope you find this helpful.

Guido Leandro Maliandi
http://blogs.southworks.net/gmaliandi

Nov 24, 2011 at 10:16 PM
Hi Guido,

Thanks for your help and reactivity! I will do it that way.

Best,


2011/11/24 GuidoMaliandi <notifications@codeplex.com>

From: GuidoMaliandi

Hi,

Considering your requirements, I don't see anything wrong with the second approach you're mentioning. I believe you could use it if it suits your scenario.

I hope you find this helpful.

Guido Leandro Maliandi
http://blogs.southworks.net/gmaliandi

Read the full discussion online.

To add a post to this discussion, reply to this email (CompositeWPF@discussions.codeplex.com)

To start a new discussion for this project, email CompositeWPF@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com