Using constants for moduleName in App.Config WPF/MVVM/UNITY

Topics: Prism v4 - WPF 4
May 10, 2012 at 5:35 PM

Hello, 

I have a need in my project to reference modules by name in my application, so instead of typing the name all over I want to use constants. Which I created, buy my question is:

How do I use those constants in my app.config file for the moduleName when I define modules?

Any suggestion will be greatly apprecited.

Developer
May 10, 2012 at 8:34 PM

Hi,

Based on my understanding, due to the nature of the App.config file it's not possible to reference a constant defined in your application inside the aforementioned file. This can be seen in the Modularity QuickStart, which define the module names using constants in the WellKnownModuleNames static class but needs to write the corresponding module names in the App.config file.

As this is not strictly related to Prism, I believe you can find more information about the App.config file and better support regarding this topic as well in the WPF forums:

Regards,

Damian Cherubini
http://blogs.southworks.net/dcherubini