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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:25:14+00:00 2026-05-31T03:25:14+00:00

We are using unity as IoC. We came across unique problem. We have created

  • 0

We are using unity as IoC. We came across unique problem.
We have created interface called IPlugin. This interface is shared across various third party vendors to develop their own plug in based on this interface. These plug ins then fits into our system.
Vendors will provide their plugs in as dll. What we want is ,
Using unity we want to resolve all assembly’s type which is implemented with IPlugin interface. I came to know that this is achievable via MEF export attribute, I am wondering whether this can be achieved via Unity using some short of extension.

Our code

Public interface IPlugin
{
    Void ProcessData();
} 

Public class DataProcessor
{
    Var pluginList = unityContainer.ResolveAssemblies<IPlugIn>()
/*
There is no such method in unity but what we want is scan all assemblies in bin folder and load all types which are inheriting from IPlugIn
*/
}

Vendor’s assembly

Public class AbcCompanyPlugIn : IPlugin
{
Void ProcessData()
{
// some code
}

}
Public class XyzCompanyPlugIn : IPlugin
{
Void ProcessData()
{
// some code
}

}
  • 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-31T03:25:15+00:00Added an answer on May 31, 2026 at 3:25 am

    You could write a bit of Reflection code that scans a folder for add-in assemblies and registers all IPlugin implementations with the container.

    Something like this ought to work:

    var assemblies = // read all assemblies from disk
    var pluginTypes = from a in assemblies
                      from t in a.GetExportedTypes()
                      where typeof(IPlugin).IsAssignableFrom(t)
                      select t;
    
    foreach (var t in pluginTypes)
        container.RegisterType(typeof(IPlugin), t);
    

    (code may not compile)

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

Sidebar

Related Questions

I am having a problem using the Unity Application Block, I have created a
I'm working on my 1st project using MS Unity IoC framework. If I have
Using Unity in an ASP.Net MVC 2 app I have various dependencies on Controllers
I have been using Unity as my IoC container for a while and I
What's pros and cons of using Enterprise Library Unity vs other IoC containers (Windsor,
I'm trying to implement this scenario using Unity and i can't figure out how
I am using unity as my IoC container. I am trying to implement a
Using the adapter pattern, combined with IoC (specificly Unity), I would like to create
I'm using the Unity IoC container. It really wasn't a decision I made, it
I'm using Prism and the Unity IoC container that comes along with Prism. However,

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.