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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:04:00+00:00 2026-06-02T16:04:00+00:00

I am trying to load assemblies dynamically through Reflection. i have folder structure like

  • 0

I am trying to load assemblies dynamically through Reflection. i have folder structure like this:

project
  \-- BIN
       |-- myApp.exe
       |-- SOMEEXTENTION1
       |    |-- someExtention1.dll
       |    \-- itsDependency1.dll
       |         
       |-- SOMEEXTENTION2
            |-- someExtention2.dll
            \-- itsDependency2.dll

I can load someExtention using reflection. Problem occurs when during execution someExtention looks for itsDependency. Dot net looks in BIN folder. It doesn’t find it there. Appdomain’s AssemblyResolve event is raised…

I am trapping this event. In ResolveEventArgs I get the name of the assembly which needs to be loaded. problem is that i don’t get the RequestingAssembly. that property of ResolveEventArgs is always empty. I need the requesting assembly so that I can look directly in its own EXTN folder. without that I have to look in all of the EXTN folders, which in my case can be quite large.

RequestingAssembly has a property Location which according to this msdn article contains the path to the physical file. this article also sites a situation when this property could be Nothing. I dont understand the Load-Context discussed there.

Any help would be appreciable…

  • 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-06-02T16:04:01+00:00Added an answer on June 2, 2026 at 4:04 pm

    From what i found with experimentation (again no search result in support), when dynamically loading assemblies, the folder name must not match the assembly name. i don’t know exactly what happens then, but something inside the loader mechanism goes haywire.

    By the way when an assembly is loaded with LoadFrom method, it gets loaded in load-from-context. in this context the dependency assemblies are resolved by first looking at the application-base then at the assembly’s own folder. in my case this solvs the problem of resolving dependencies.

    on the downside i found that if load-from fails to resolve a dependency and AssemblyResolve event is triggered then requesting assembly will not be available. that means the path-to-requesting-assembly could not be determined.

    rather than using load-from, when i used LoadFile method, then the dependencies are NOT automatically resolved from the subfolder. Rather AssemblyResolve event is triggered. in this case though the ResolveEventArgs will contain the requesting assembly property. from where the user code can easily determine the target path. then the user code can load the dependency.

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

Sidebar

Related Questions

I have an Assembly A , this Assembly dynamically loads Assemblies B , C
I am trying to load the referenced Assemblies through an iteration. I load the
I have a problem with out of memory when I'm trying load a few
When trying to load Microsoft.Xna.Framework.dll from any project, it throws a FileNotFoundException. The specified
I'm trying to load some default assemblies and init some variables with ironruby, and
I'm trying to load an assembly without locking the file. These assemblies could be
I am trying to introduce Strong Signing in my project assemblies. My project output
I have trouble with some inline assembly code. I'm trying to load items from
I have a situation where I need to be able to load assemblies in
I am trying to dynamicaly compile code using CodeDom. I can load other assemblies,

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.