Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9186035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:25:31+00:00 2026-06-17T19:25:31+00:00

i’m new in the plugin world and force to unterstood mef. Currently i know

  • 0

i’m new in the plugin world and force to unterstood mef.
Currently i know how i can load plugins from a specific folder.
Now i have some questions:

  • Can i load plugins from a folder which are specify in a configuarations file (Serialization) ?
  • How i can unload plugins ?
  • How can i load plugins with a specific version between min&max version?
  • How i can wrap the catalog & compose e.g. as something like “MEF Manager”

optionaly:

  • How i can display forms from plugin?

thanks for help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T19:25:32+00:00Added an answer on June 17, 2026 at 7:25 pm

    Can i load plugins from a folder which are specify in a
    configuarations file (Serialization) ?

    Yes you can load plugins from folders using MEF’s DirectoryCatalog class. You will have to add you own section in the configuration file though and create a DirectoryCatalog for each folder where plugins are located. Unraveling the Mysteries of .NET 2.0 Configuration contains great information on how to use the classes in the System.Configuration namespace.

    How i can unload plugins ?

    This depend on wht you mean by unloading a plugin.

    • Unloading plugins when an assembly is removed from a folder can be done using the AllowRecomposition property of the import attributes of MEF and a FileSystemWatcher for each plugin folder to monitor deleted .dll files and call the DirectoryCatalog.Refresh method to force an update on the MEF container. Note though that by default you cannot delete assemblies that are loaded by .NET. To overcome this .NET supports Shadow Copying. Have a look at the The Way of MEF code by Glenn Block. The PartUpdatesInPlace is a good example on how to do this.

    • Unloading plugins without the filesystem is a different thing. You will have to do this yourself. Usually you will need a plugin manager that can unload plugins at will.

    Note though that the loaded assemblies will not be unloaded only the plugins.

    How can i load plugins with a specific version between min&max
    version?

    You can use MEF’s Export Metadata to add plugin metadata. Then you the GetExports method of the CompisitionContainer and check the metadata before accesing the actual plugin. This is standard procedure with MEF-based plugin solutions. Also have a look at the ExportFactory class that was added in MEF2 for a better approach.

    How i can wrap the catalog & compose e.g. as something like “MEF
    Manager”

    Start by a very simple plugin manager class that provides the basics (depend on what you want to do) and build from this.

    How i can display forms from plugin?

    You can do it in the same way as you would do it without MEF. For example you can add a form property to your plugin inteface/base class and make each plugin responsible for creating/disposing it.

    Before you start doing all this I would advise you to check Prism (Composite Application Guidance) and Smart Client Software Factory. These are powerful frameworks for WPF and WinForms applications that need great flexibility. If you decide to check them out I think the best way is to play around with samples.

    Good luck

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know how can I replace this 2 symbol below from the string
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I want use html5's new tag to play a wav file (currently only supported
I am currently running into a problem where an element is coming back from
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.