views:

23

answers:

2

Hi,

Im looking at using MEF to load plugins into my application to allow for customisation, and have a couple of quick question that I not seen answered in the sample apps I have looked at:

1) Can MEF only load XAP files from the web site hosting the main XAP

2) Do I need to create a "Silverlight Application" project for each plugin or is there another project type or another way to generate the XAP file

3) What is the best way to automate the copying of the XAP files for the deployment folder in the web application

Thanks

Wayne

A: 

check out this series of post that gives you details on that topic

http://blogs.msdn.com/b/gblock/archive/2009/11/30/building-the-hello-mef-dashboard-in-silverlight-4-part-i.aspx

http://blogs.msdn.com/b/gblock/archive/2009/12/05/building-hello-mef-part-ii-metadata-and-why-being-lazy-is-a-good-thing.aspx

http://blogs.msdn.com/b/gblock/archive/2009/12/15/building-hello-mef-part-iii-xap-partitioning-with-the-host-s-permission-and-the-sweetness-of-recomposition.aspx

http://blogs.msdn.com/b/gblock/archive/2010/03/08/building-hello-mef-part-iv-deploymentcatalog.aspx

http://blogs.msdn.com/b/gblock/archive/2010/03/08/building-hellomef-part-v-refactoring-to-viewmodel.aspx

to your questions: 1.) no, you can also go cross domain. 2.) You can have a set of plugins in one xap or you can have one plugin per xap. And yes to create a xap you need a silverlight application project and you can remvove App.xaml / MainPage.xaml 3.)Checkout the Deployment Catalog in Part IV of the above articles

hope this gives you a jumpstart...

silverfighter
A: 

See this documentation. You have the whole thing detailed.

Jérémie Bertrand