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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:51:13+00:00 2026-05-26T18:51:13+00:00

I have an Assembly A , this Assembly dynamically loads Assemblies B , C

  • 0

I have an Assembly A, this Assembly dynamically loads Assemblies B, C, and E. And it’ll load more in the future.

Issue one:
B references F and G, when I try to execute methods in an instance of a type declared in B, from A, I get an exception telling me that F wasn’t found, of course.
Questions:

  1. How can I reference F and G when I dynamically load Assembly
    B, assuming F and G are in the same folder as B?
  2. How can I reference F and G when I dynamically load Assembly
    B, assuming F and G are in a different folder?

Issue two:
This pretty much comes from the fact that, in trying to quickly test some functionality, I copied the referenced assemblies from B‘s binaries folder to A‘s, which resulted in the following exception:

Could not load file or assembly ‘log4net, Version=1.2.10.0,
Culture=neutral, PublicKeyToken=1b44e1d426115821’ or one of its
dependencies. The located assembly’s manifest definition does not
match the assembly reference. (Exception from HRESULT: 0x80131040)

I assume this comes from the fact that I’m using a different version of log4net than one of the dependencies of B does.
Question:
What measure can I take to avoid this kind of versioning issues?
Will fixing issue one fix this issue? If not, why?


Should I use Autofac for this?
Will it help me? How?

Keep in mind the idea of Assembly A is to take “plugins”, and in that order, declaratively pointing at the Assemblies or their dependencies isn’t an option

  • 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-26T18:51:14+00:00Added an answer on May 26, 2026 at 6:51 pm

    As long as the assemblies are compatible in version, you can instruct the CLR to load a specific version regardless of what version the assembly you depend on was compiled against.

    For instance, adding this snippet to your configuration file will redirect 1.0.0.0-2.0.0.0 of System.Web.Mvc assembly to use 3.0.0.0.

    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
                <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
                <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" />
            </dependentAssembly>
        </assemblyBinding>
    </runtime>
    

    You can use the same principle for any assembly, e.g. log4net.

    That said, your preferred solution should be to obtain a version compiled against the correct assembly version. For example, log4net is available in source and therefore easy to download and recompile with the updated dependencies.

    If you are unsure exactly what assembly is causing the problem, there is a tool called Fusion Log Viewer (fuslogvw.exe) which is installed along with the .NET framework. It’s a bit quirky to use but will show you exactly where .NET searches for assemblies and any errors that occur during assembly resolution.

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

Sidebar

Related Questions

This is strange. I have a windows application that dynamically loads DLLs using Reflection.Assembly.LoadFrom(dll_file_name_here)
What I have now (which successfully loads the plug-in) is this: Assembly myDLL =
I have a WPF project where I load a WindowsForsm assembly (dll file) dynamically
I have an assembly that contains an embedded resource. However, when this assembly is
I have an assembly containing a number of classes. This is a class library
I have this: SolutionName: Foo.sln Assembly: Foo.Bar Namespaces are: Foo.Bar.Views Foo.Bar.Model Foo.Bar.BusinessObjects Foo.Bar.Services Should
I have this kind of code in some applications (from microsoft) [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage( Microsoft.Naming,
I have this code to register dlls into my gac Assembly asm = Assembly.LoadFrom(argument);
I have an application that compiles some code dynamically, and creates an assembly as
I have an application that loads a DLL to execute a specific part of

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.