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 8820671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:39:57+00:00 2026-06-14T05:39:57+00:00

I’m using Prism with MEF Extensions and am having some trouble with project setup

  • 0

I’m using Prism with MEF Extensions and am having some trouble with project setup regarding an import to an interface. The problem is that the interface doesn’t live in the same assembly as the concrete implementation (because there are other concrete implementations in other projects as well using the same interface).

So because I only have a reference to the project with the interface, and the concrete implementation is never directly referenced in my main app, it never gets included in the bin directory. So at run time MEF composition fails because its trying to inject a class for which there is no assembly containing the implementation.

What is the right way to do this? I could always copy it to the bin dir, but that sucks… or I could copy it to a plugin directory, but that sucks too, because the other concrete implementations would have to live in that same plugins directory.

Either I’m totally missing something, or this is not a good use for MEF, or …?

  • 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-14T05:39:58+00:00Added an answer on June 14, 2026 at 5:39 am

    MEF implementation modules generally are not referenced by the main project – the whole point of MEF is to be able to load different stuff at runtime.

    I create a post-build action in the main project in VS to copy the MEF modules to whatever the main project is expecting to find MEF modules in – either bin, or a subdir of bin.

    You could instead change the build output directory in each of the MEF module projects to output the module binaries to the main project bin dir or subdir of bin.

    I’m not familiar with Prism, but with plain old MEF with .NET 4.0 I construct a MEF catalog of the MEF module file paths, usually from info found in the main project’s config file. (Loading all dlls found in a directory is an invitation for trouble)

    Even though the main project doesn’t reference the MEF modules, you can still get VS to build the MEF modules when you build the main project, by adding the MEF modules to the Project Dependencies of the main project. Make sure all the MEF module projects are included in the same solution as the main project. Right click on the main project in the Solution Explorer, select Project Dependencies, and put a check mark next to all the MEF modules. This will also cause the main project to be recompiled when the MEF modules change, which isn’t strictly necessary but still a good idea in case you change an interface somewhere.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text

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.