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

  • SEARCH
  • Home
  • 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 7429487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T08:58:40+00:00 2026-05-29T08:58:40+00:00

everyone The problem is if there exists two exported components which have the same

  • 0

everyone

The problem is if there exists two exported components which have the same export signature but only one should be imported ( this is possible, the practical example is install new plugin to replace the old one without uninstall the old one. ). We can provide a configuration file to tell which component should be imported, but the question is how to tell MEF the right selection?

I have three methods:

  1. Use a custom catalog, filter the available plugins. But suppose the situation that A imports component A and B imports component B while the component A and B have the same export signature. A custom catalog cannot handle this except we create new custom catalog for each component.

  2. Interception in MEF composition. I am not sure if it is possible and I don’t know how. But if there’s a way let us intercept in composition process, this could be the best one.

  3. Use a import wrapper instead of real interface. When the component is constructing, it will initialize the wrapper and let the wrapper handle the selection logic ( such as prompt a window and let user select one or read configuration )

  • 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-05-29T08:58:41+00:00Added an answer on May 29, 2026 at 8:58 am

    what about the use of [ImportMany] to get all possible imports for the same signature and then choose the one you want for certain condition (config file or something else) from this list of imports?

    EDIT: i like your suggestion number 3, i think this one could be easy. your wrapper handles the real interfaces with [ImportMany] and the plugins ask your wrapper for GetTheOneInterface().

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

Sidebar

Related Questions

I have a problem in my project with the .designer which as everyone know
Hie Everyone I have 1st time developed SSRS in my WPF application.. but there
I suppose everyone runs into this problem once in a while: you have two
Good day everyone. This problem was part of another one which it as been
Hi everyone my problem today is I have a couple of buttons that slide
hey everyone, here is the site SEE BELOW I have a slight jquery problem
This problem smells like there should be an answer in graph theory, but it
Hi there everyone im new to PHP and Joomla and I have developed a
I have two strings. They are both very long, but I have used echo
Problem (simplified to make things clearer): 1. there is one statically-linked static.lib that has

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.