Unable to set up an Silverlight application with modules and MEF

Topics: Prism v4 - Silverlight 4
Oct 9, 2010 at 12:18 PM

Hello,

I set up an Silverlight application that uses one module. The bootstrapper is a MefBootsrapper and I want to use only MEF in the applciation.

I used the DeploymentCatalog to download my XAP module. I put a brakpoint in the completed handler and it ran there without any errors.

 

But after the Bootstrapper.Run() ends, it crashed with :

Unable to retrieve the module type MyNamespace.MyModule, MyAssembly from the loaded assemblies.  You may need to specify a more fully-qualified type name.

 

Can you help me with this. I don't understand why I got this error since the download is completed and my ModuleCatalog.xaml seems good. 

 

Thanks,

Adrien

Oct 12, 2010 at 1:40 PM

Hi Adrien,

Based on the error you are receiving I think that you can find interesting the following two forum threads, where other users experienced similar problems:

Hope this helps.

Fernando Antivero
http://blogs.southworks.net/fantivero

Oct 12, 2010 at 2:24 PM
Edited Oct 12, 2010 at 2:25 PM

I was able to solve the problem by adding ", Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" at the end of the module type. It seems that Silverlight needs the complete module type. My code works well in WPF but not in Silverlight, it's why I don't find the fix quickly.

Thanks for your response.

 

Adrien.

Oct 12, 2010 at 3:00 PM

Hi Adrien,

Nice to see that you find the solution for this and thanks for sharing this with the rest of the community, since it might help other users with a similar scenario.

Fernando Antivero
http://blogs.southworks.net/fantivero