I'm on a team developing a RIA using Silverlight 3 and PRISM v2.
We're still in sort of a prototyping mode, and the application is contantly growing in size - which is starting to become a problem.
A lot of the same DLLs are referenced in the different modules (projects), and all these are compiled into the different xaps which makes them bigger than really necessary.
We can avoid this ofcourse by setting the "Copy Local"-property on the different references to "No", and make sure the component is referenced in another part of the solution (ie. the Shell).
This is not the best approach in my opinion, because it will soon end up being a mess trying to control which DLLS are used at any given time.
Another approach I've considered is to make a post-compile script, which extracts all the "module-xaps" and copies all content into a new xap - hence making sure there are only one copy of each DLL.
If doing so, I have to change the ModulesCatalog to reference the new xap, and put all modules in the same group (modulegroup).
I think this will work, but it doesn't feel quite right...
Does anyone have any thoughts on, or experience with this??
The recommended approach in the Prism documentation is the first one you mentioned. You can find that explanation in this article:
At a first glance, if you take the second approach you would be losing some benefits of loading modules remotely greatly increasing the download size of your application (thus increasing the time to load).
For example (and this is just one of the things you will not be able to do), if you have a module that is
loaded on demand, with the first approach it will only be loaded when it is requested, while using the second approach will load it with the rest of the application.
Please let me know if this helps.