OOB CheckAndDownloadUpdateAsync and Prism Modules

Topics: Prism v4 - Silverlight 4
Feb 27, 2011 at 9:44 PM

I am building an OOB Silverlight app that needs constant updates, i will call CheckAndDownloadUpdateAsync, and by reading the prism documentation i understand that this will only update the main XAP file, not the modules.  How do i build prism modules that are all contained inside a the single main XAP so i can update my hole app?  I don't care that my users are downloading all the modules,  and if this is possible can i selectively load my modules offline from that single XAP?

Thank you.

Feb 28, 2011 at 6:01 PM

Hi,

In order to include your modules inside the main XAP file, you could make your modules based on the Silverlight Class library template. You might find the following thread useful, as it provides further explanations about this:

Also you might find additional support in the Silverlight forums.

Thanks,

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

 

Feb 28, 2011 at 9:43 PM

i can make this work with unity by making a silverlight class library and then adding a reference to it on the shell.  but if i try this with MEF :

 

            moduleCatalog.AddModule
            (
                new ModuleInfo
                {
                    InitializationMode = InitializationMode.WhenAvailable,
                    Ref = "DllModule",
                    ModuleName = "DllModuleImp",
                    ModuleType = "DllModule.DllModuleImp,DllModule , Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
                }
            );

I get this error:

 

Microsoft JScript runtime error: Unhandled Error in Silverlight Application Code: 4004    

Category: ManagedRuntimeError      

 Message: Microsoft.Practices.Prism.Modularity.ModuleTypeLoadingException: Failed to load type for module Module1Impl. 

If this error occurred when using MEF in a Silverlight application, please ensure that the CopyLocal property of the reference to the MefExtensions assembly is set to true in the main application/shell and false in all other assemblies. 

 

I naturally done  what the error suggested but it still fails

 

 

Developer
Mar 1, 2011 at 4:52 PM

Hi,

You could try adding an assembly catalog to the Aggregate Catalog, as it is done with modules A and C in the MEF Modularity QuickStart.

I hope you find this helpful.

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