4
votes

Im trying to determine if MEF (from codeplex) is right for my needs. I know MEF supports on-demand loading of Xap files. But does anybody know if it supports on-demand loading of silverlight libraries (dll's)?

Thanks.

2
Why would you not create Silverlights apps for each DLL you want to separate and remove the unwanted XAML files? That is the equivalent of a module in the Prism framework/pattern. Downloading a compressed DLL in a XAP is more efficient than downloading uncompressed DLLs (unless they are tiny). - Gone Coding
A Dll is compressed as it is, it'll probably not gain that much more (if any) compression by zipping it up. Also, i dont want to create xaps (a separate application) when all I want is a library. Plain and simple. - AlvinfromDiaspar

2 Answers

4
votes

The DeploymentCatalog makes it easy to download a XAP file. We don't have built in functionality to help downloading a DLL directly, but if you download it yourself and load it as an assembly (ie with Assembly.Load), you can use an AssemblyCatalog to create a catalog for that assembly that you can use with MEF.

1
votes

Here's a modified version of the DeploymentCatalog that allows you to download either DLLs or XAPs.

http://pietschsoft.com/post/2010/10/22/Silverlight-Modify-MEF-to-load-plugins-from-DLL-and-XAP-files.aspx

This was so simple to add, it's a wonder why they didn't add it in the first place.