views:

650

answers:

1

I'm using prism as an example; this is my first time playing with WPF. I've written two modules; orderModule and orderDetailModule. I was able to run my app and have them populate on one screen, now I'm trying to have only one module load and load the other with a button click. I was loading my modules in code before, then I noticed prism is using xml so I'm trying do this as well. For some reason it can't find them, the full error I get is:

Microsoft.Practices.Composite.Modularity.ModuleInitializeException was unhandled Message="Unable to retrieve the module type NetworkOrderManagement.WPF_Modules.Order, OrderModule from the loaded assemblies. You may need to specify a more fully-qualified type name."

This is the modules section in my app.config:

<modules>
<module assemblyFile="WPFOrderModule.dll" 
        moduleType="NetworkOrderManagement.WPF_Modules.Order, OrderModule" 
        moduleName="OrderModule"/>
<module assemblyFile="WPFOrderDetailModule.dll" 
        moduleType="NetworkOrderManagement.WPF_Modules.OrderDetail, OrderDetailModule" 
        moduleName="OrderDetailModule" 
        startupLoaded="false"/>

From link text

Within the modules configuration section, define your module. To do this, add a module XML element. This element has the following attributes:

assemblyFile. This attribute specifies the location of the module's assembly. This attribute is required.

moduleType. This attribute specifies the type within the module's assembly that implements the IModule interface. This attribute is required.

moduleName. This attribute specifies the module's name. This attribute is required.

startupLoaded. This attribute specifies whether the module is loaded at startup. If its value is true (this is the default value), the module should be loaded at startup. If its value is false, the module should not be loaded at startup; instead, it should be loaded on demand. This attribute is not required.

My OrderModule which implements IModule is in the namespace NetworkOrderManagement.WPF_Modules.Order.

Any Ideas?

+3  A: 

This is probably using reflection to load the module based on its type. You must use the fully qualified type name for reflection to work. This is typically of the format: "Full.Namespace.TypeName, AssemblyName". This would be the most basic naming. If this does not resolve, then you must start adding addtional attributes, including things like Version, Language, etc.

Adam Fyles
It's working now, I had "Namespace, TypeName" with no assembly.
Justin Holbrook