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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T01:55:36+00:00 2026-05-21T01:55:36+00:00

I am converting a home-grown plugin architecture to .NET 4.0’s MEF. The MEF-based application

  • 0

I am converting a home-grown plugin architecture to .NET 4.0’s MEF. The MEF-based application works wonderfully when it is run from my local machine. When I move the application to network share and then run the application, however, MEF no longer loads my plugins.

When I attach a debugging session to the process and inspect the DirectoryCatalog object I see there are no items in the Assemblies or Parts properties. The FullPath is the correct directory and the LoadFiles property includes all of the DLLs in the directory being searched.

At first I thought this was a CasPol issue until I tried to modify the CasPol and received a warning saying that CasPol is no longer enabled by default in .NET 4.0. It must be something else. I have Full permissions to the directory in question.

Here is the property which will contain the imported AddIns:

[ImportMany]
private IEnumerable<IRecipient> RecipientAddIns;

And here is the method that discovers and imports the AddIns:

private void LoadRecipientAddIns()
{
  using (var catalog = new AggregateCatalog())
  {
    // Look for IRecipient AddIns in the ./Recipients directory.
    catalog.Catalogs.Add(new DirectoryCatalog("Recipients"));

    // Look for IRecipient AddIns in subdirectories hanging off of ./Recipients.
    foreach (string currentDirPath in Directory.GetDirectories("Recipients"))
      catalog.Catalogs.Add(new DirectoryCatalog(currentDirPath));

    using (var compositionContainer = new CompositionContainer(catalog))
    {
      compositionContainer.ComposeParts();
      compositionContainer.SatisfyImportsOnce(this);

      // The discovered AddIns should now be in the RecipientAddIns property.
    }

    // Do stuff with the Recipient AddIns
    foreach (var recipient in this.RecipientAddIns)
    {
      ...
    }
  }

  // Clear the list of discovered Recipient AddIns
  this.RecipientAddIns = null;
}

Any ideas?

Thank you.

  • 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-21T01:55:36+00:00Added an answer on May 21, 2026 at 1:55 am

    Try loading the assemblies yourself (ie with Assembly.Load or LoadFrom). I suspect you’ll get an exception, which the DirectoryCatalog is probably swallowing. The exception should help you figure out what’s wrong.

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

Sidebar

Related Questions

I am considering converting a project that I've inherited from .net 1.1 to .net
Converting a couple stored procedures from MySQL to Microsoft SQL server. Everything is going
I am converting from existing CVS repository to SVN repository. CVS repository has few
I'm converting an application to use Java 1.5 and have found the following method:
I'm converting all of our Crystal Reports to use a home-built reporting system. Essentially,
I am converting a website from ISO to UTF-8, so I need to convert
I am connected to university Linux server from home using PuTTY. I upload entire
Converting a database of people and addresses from ALL CAPS to Title Case will
I'm a bit further along in converting some sample test/specs from Watir to Selenium.
I get this error on my application when i try to run in Tomcat,

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.