This project has moved. For the latest updates, please go here.

Dynamic module loaded multiple times

May 27, 2011 at 6:53 PM

Has anyone ever seen a case where the same dynamic module is loaded multiple times. I am scratching my head as to why.

The approach I am taking is to use the export of ViewXapRoute object to relate view names to the xap file, and then using View Navigation to trigger the load. I have a startup class (IModuleInitializer) in the module thats logging the fact that it's being loaded. I can't figure out why. i was under the impression that Jounce loads the module once only. 

This is causing me some problems elsewhere in the app, as many of the contracts that are being exported are being duplicated in collections on the import side. 

Any pointers you can give, would be greatly appreciated.

May 29, 2011 at 4:03 PM

The most common reason for this is adding external modules but failing to flag duplicate DLLs as copy local = false. In other words, if you create a second XAP and reference MEF, you don't want that copy in the XAP because there will already be one in the host. Including it can result in having a completely separate assembly loaded which means a different set of containers, catalogs, etc. The key is anything in your satellite assemblies that is already referenced in the parent should be set to Copy Local false in the properties dialog. This has the added benefit of making the XAP significantly smaller as well.