Loading Modules by config file with MEF bootstrapper and desktop application

Topics: Prism v4 - WPF 4
Aug 9, 2012 at 5:09 PM

I'm new in prism and I'm trying to load my modules from app.config, but It doesn't work for me. Loading the modules from code or directory works fine.

The CreateModleCatalog looks like that.

protected override IModuleCatalog CreateModuleCatalog()
{
       return new ConfigurationModuleCatalog();
}

To the AggregateCatalog, I only add the assembly itself.

It seems that the modules are loaded and initialized (The debugger enters the  Initilize method in the Module class (that class which inherites from IModule), but the Views and ViewModels are not created.

How can I use the config file to defines modules to load?

Developer
Aug 9, 2012 at 7:17 PM

Hi,

Based on my understanding, if the modules are being load and initialized, it means that your application is able to locate your modules through your configuration catalog correctly. Therefore, the problem might not be the configuration catalog itself.

In order to help you find the cause behind your problem, it would be helpful if you could provide us with more information regarding your scenario or with the code snippets of your module catalog and module classes, so that we can help you further with this.

Regards,

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

Aug 10, 2012 at 9:45 AM
Hi,

Thanks a lot for your help. In my test app, I have modules with views and viewmodels which should be hosted in the shell, a core lib containg common stuff and the start project. I need to have at least three regions in my app, a toolbar region and a navigator region which are hosting "fixed" modules after start up, but they could be replaced by another toolbar or navigator module later. Further I have a main region which should host views from different, independent modules (as plugin) and only at runtime the view to load is known.

I put my solution on, but I'm still at the beginning of implementing those scenarios.

Regards,

Anne




________________________________

Von: DCherubini [email removed]
Gesendet: Do 09.08.2012 20:17
An: Anne Schmid
Betreff: Re: Loading Modules by config file with MEF bootstrapper and desktop application [CompositeWPF:390892]



From: DCherubini

Hi,

Based on my understanding, if the modules are being load and initialized, it means that your application is able to locate your modules through your configuration catalog correctly. Therefore, the problem might not be the configuration catalog itself.

In order to help you find the cause behind your problem, it would be helpful if you could provide us with more information regarding your scenario or with the code snippets of your module catalog and module classes, so that we can help you further with this.

Regards,

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

Read the full discussion online <http://compositewpf.codeplex.com/discussions/390892#post897695> .

To add a post to this discussion, reply to this email ([email removed] <mailto:[email removed]?subject=[CompositeWPF:390892]> )

To start a new discussion for this project, email [email removed]

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe <https://compositewpf.codeplex.com/discussions/390892/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