Questions About Attributes of Element "module"

Topics: Prism v2 - WPF 3.5
Aug 13, 2009 at 8:14 PM

Hello All,

Please consider this snippet from App.config:



   moduleType="MyModule.MyModule, MyModule"



I'd like to ask...

1. What purpose does the highlighted MyModule serve? The relevant qualified type has already been spelled out by MyModule.MyModule (before the comma).

2. Is the value assigned to "moduleName" just an arbitrary developer-assigned string?

3. Is there any way I can access, in code, the value assigned to "moduleName"?




Aug 14, 2009 at 5:36 PM

Hi Dave,

The highlighted MyModule is the name of the assembly where the class that implements IModule is. The complete format is:

  • assemblyFile: The assembly file where the class is.
  • moduleType: Full class name of the class that implements IModule. Format: [namespace].[classname], [assemblyname]
  • moduleName: The name of the module, unique Id. It is a string. You can later use this for example to load modules on demand.

Please let me know if this helps.

Damian Schenkelman

Aug 14, 2009 at 5:52 PM


Thank you very much for the reply!

Given that the highlighted MyModule is the assembly name, how does it provide any information that assemblyFile="MyModule.dll" hasn't already provided? Are they redundant?

With regard to "moduleName", what I'm trying to do is sort of the opposite of loading modules on demand. I want to load multiple instances of the same module at startup by placing multiple "module" elements in App.config, each with a unique "moduleName". I'd then like each module instance to be able to inspect its "moduleName" so it can use that to go out and get instance-specific configuration information. For example instance 1 of module AcmeABC123Module might talk to an AcmeABC123 device on channel 4 whereas instance 2 of module AcmeABC123 might talk to a different AcmeABC123 device on channel 5. There's more on this in my recent post "Creating Multiple Instances of a Module".