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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T03:04:33+00:00 2026-05-15T03:04:33+00:00

I have been given the task of rewriting an internal utility in .Net for

  • 0

I have been given the task of rewriting an internal utility in .Net for my work. One of the program requirements of the new system is to have a DLL that implements a set of interfaces and have the program call the DLL.

Now this DLL will be changed out a lot per deployment. My question is what is the best way to do it from a development standpoint? Do I add a template DLL (one that only has the interfaces but no implementation) to the project references like I would do any other DLL that I would use?

Or do I need to use something like this every time I want to use code from the DLL?

var DropIn = System.Reflection.Assembly.LoadFrom("DropInDll.dll");
var getActions = DropIn.GetType("Main").GetMethod("GetActions");
List<IAction> ActionList = (List<IAction>)getActions.Invoke(null, null);
  • 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-15T03:04:34+00:00Added an answer on May 15, 2026 at 3:04 am

    Use Dependency Injection with an Inversion of Control Container.

    Since you are already coding to defined interfaces, you shouldn’t need any reflection.

    Here’s an example using the Common Service Locator from CodePlex, specifically the Simple Service Locator implementation.

    Say you have a IDropIn interface, and different DLLs that implement the interface.

    First, you need to register your interface with the system:

    void Init()
    {
        // Read dropInDllName and dropInClassName from your config file
        Assembly assembly = Assembly.Load(dropInDllName);
        IDropIn dropIn = (IDropIn)assembly.CreateInstance(dropInClassName);
    
        SimpleServiceLocator container = new SimpleServiceLocator();
        container.RegisterSingle<IDropIn>(dropIn);
    
        Microsoft.Practices.ServiceLocation.ServiceLocator.SetLocatorProvider(() => container);
    }
    

    Then, to get an instance in your code somewhere else, do this:

    IDropIn dropIn = ServiceLocator.Current.GetInstance<IDropIn>();
    List<IAction> actionList = dropIn.GetActions();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been given the task at work of screen scraping one of our
I am a student on a work placement. I have been given the task
I work in the Systems & admin team and have been given the task
I have been given a task to display data on an ASP .net page
I have been given the task of bringing three legacy systems together into one
I am new 2 C# and i have been given a task... I have
I have been given the task of running two threads one using extends and
I am new to Qt , I have been given this task where i
I have been given the task to fix an Embedded Operating System which is
Hi I am very new to javascript. i have been given the task to

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.