ModulesCatalog.xaml and DLL

Topics: Prism v4 - Silverlight 4
Mar 1, 2011 at 9:46 PM

Usually, I specify path to the XAP file for ModuleInfo's Ref attribute. But is it possible to specify DLL instead of XAP? The reason - I have some core modules that are located in Silverlight Class Library project and statically linked to the main Silverlight application, and I don't want to create a separate Silverlight application for them. But at the same time I want to have only one place to configure all my modules - ModuleCatalog.xaml file. So, can I add reference to a module located in DLL in the ModuleCatalog.xaml file?

Mar 2, 2011 at 2:21 PM

Hi,

The Silverlight security model does not allow you to load assemblies from the file system. This means you can´t specify in the Ref property of the XAML ModuleInfo element, a DLL located in the file system.

You will need to package all your module´s DLLs in a XAP file in order to use them as modules loaded in a Silverlight Prism application.

I hope you find this information useful.

Thanks,

Miguel Bronzovic
http://blogs.southworks.net/mbronzovic

 

Mar 2, 2011 at 10:04 PM

Hi Miguel,

I don't want to specify DLL located in the file system, I want to specify DLL located in the XAP file of the main Silverlight application (that contains bootstrapper, shell, etc.)

Developer
Mar 3, 2011 at 2:36 PM

Hi,

The scenario you're describing isn't possible out-of-the-box. You might use other of the mechanisms for loading modules to load the ones that are statically referenced by your shell project. For example, if you're using MEF you could add an AssemblyCatalog to the AggregateCatalog.

You might find more information about this in the following resources:

I hope you find this helpful.

Guido Leandro Maliandi
http://blogs.southworks.net/gmaliandi

Mar 24, 2011 at 12:29 AM

Thanks, Guido.