Monday, November 30, 2009

MEF: Build a Plugin in Under 10 Minutes

In preparing for an upcoming talk I'll be giving on the Managed Extensibility Framework (MEF), I wanted to demonstrate how fast and easy it is to use in a sample, reference application. This application creates a dynamic plugin. I first link a plugin and show it active, then I create a second plugin and show how it is dynamically added to the program during runtime. It all takes under 10 minutes and would be faster if I didn't want to pace the demo to show the steps involved.

Here is a direct link to the video

Here it is embedded:

Jeremy Likness

12 comments:

  1. Nice demo for devs. I can see myself using this when our clients need our custom developed solution to be extensible.

    I'd like to know:
    1. How does it handle multiple versions of the same assembly e.g. where some code that started with the old version must complete using the old version but code that starts now must use the current plugin version.
    2. How would you secure the plugin assembly (e.g. in Firefox where malware is targetting the plugin)?

    ReplyDelete
  2. 1. Extended interface?
    2. That's something you'd need to do using signing or some other mechanism to validate the plugin before allowing it to "play."

    ReplyDelete
  3. Is there supposed to be no sound?

    ReplyDelete
  4. Nice example...

    How do you would distinguish what plugin to execute from some logic? Metadata? Some nice additional example? Thanks

    ReplyDelete
  5. Sure ... follow my "MEF" tags and you'll see some posts. The region management/Prism-related ones have specific examples of using metadata to filter imports.

    ReplyDelete
  6. That's exactly what I need for my dissertation.

    Thank you.

    Matioli

    ReplyDelete
  7. Where did the video go? Link/Embed is dead?

    ReplyDelete
  8. If anyone can find the video please post

    ReplyDelete
  9. Where is it gone? Anybody found it?

    ReplyDelete
  10. Still gone...
    "You don't have permission to access /watch/stV0JWQk1IR1xWRl1fXVhcUlNS on this server."

    ReplyDelete
  11. I can not see the video.... "This is somewhat embarrassing, isn’t it?
    It seems we can’t find what you’re looking for. Perhaps searching can help." please help me... I need see this video

    ReplyDelete