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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:43:08+00:00 2026-05-14T02:43:08+00:00

From managed code, how do I load a managed type from another assembly at

  • 0

From managed code, how do I load a managed type from another assembly at runtime, assuming the calling code does not have a static reference to the assembly?

To clarify, let’s say I have class Lib in Lib.cs compiled into Lib.dll. I want to write a class Foo in a separate assembly called Foo.dll, that does not have a reference to Lib.dll statically, but instead loads Lib.dll and then reflects on for the presence of the class Lib and then calls a method on it.

Sorry for such an obvious question on Reflection. I figure it’ll take much lesser time to get the answer on a forum that to read a few articles.

  • 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-14T02:43:08+00:00Added an answer on May 14, 2026 at 2:43 am

    Here is a short snippet:

    Assembly assembly = Assembly.LoadFile("Lib.dll");
    ILib lib = (ILib)assembly.CreateInstance("Lib");
    lib.doSomething();
    

    Of course the Lib class must implement the ILib interface which must be accessible both from Foo.dll and Lib.dll. This way you achieve abstraction.

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

Sidebar

Related Questions

I am using WinDbg to load a crash dump from managed code (C#, a
I trying to write a simple function to call unmanaged code from managed code.
PostSharp 2.0 includes a CLR host and implements IHostAssemblyStore::ProvideAssembly. From managed code, I invoke:
Is there an easy way to set the volume from managed .net code?
Is it possible to call managed code, specifically IronRuby or IronPython from unamanaged code
My code : http://jsbin.com/epuxu With help from SO, I managed to get addresses geocoded
I'm building a python application from some source code I've found Here I've managed
I have a problem that I have not managed to solve. I developed a
Does WinRT under windows 8 metro allow you to dynamically load and execute code?
I'm using EntityFramework code first with migrations. From the package manager console, I'm running

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.