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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T20:00:50+00:00 2026-05-21T20:00:50+00:00

Alright, I have a strange one here. We currently have a tools application that

  • 0

Alright,

I have a strange one here.

We currently have a tools application that allows us to create plugins, which are just DLLs with usercontrols, that I just load using Assembly.Load and create new instance, add to panel to use.

However a plugin could have 3rd party dlls included.

How can I handle this?

I’ve tried zipping up the plugin and reading the assembly via byte[], but I get an error when trying to load, missing dependant dll, so I went even farther, added dependant dlls into zip and read them, same error..

Perhaps I can create a folder with plugin name with dependant dlls?

  • 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-21T20:00:51+00:00Added an answer on May 21, 2026 at 8:00 pm

    I recently had a project with exactly the same problem. Here is how did I solve it:
    – create a separate directory for each module (plugin), inside I put main module.dll library and directory lib, where I put all the module-dependent libraries.
    – in main Form_Load event put

    AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(LoadModuleResolveEventHandler);
    

    where LoadModuleResolveEventHandler is:

    private Assembly LoadModuleResolveEventHandler(object sender, ResolveEventArgs args)
    {
        if (pluginDirectory != null)
        {
            string path = Path.Combine(pluginDirectory , "lib");
            if (Directory.Exists(path))
                foreach (string file in Directory.GetFiles(path))
                {
                    if (AssemblyName.GetAssemblyName(file).FullName == args.Name)
                    {
                        //Return the loaded assembly.
                        return Assembly.LoadFrom(file);
                    }
                }
        }
        return null;
    }
    

    It makes the application to look in pluginDirectory (where the plugin module is) /lib subdirectory, for a referenced .dll, and return it if found. I did similar in plugin’s code, maybe you don’t have to… That’s it.

    Other possibility is to add to the project new item: Application Configuration File, and put the code below:

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <probing privatePath="lib;lang" />
        </assemblyBinding>
      </runtime>
    </configuration>
    

    It creates application_name.exe.config file which must be deploy with main form executable and indicates addicional directories where to look for assembly resolving.

    You can tray any of this solutions and see how they work.
    Best regards,
    mj82

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

Sidebar

Related Questions

we have a application, which loads several plugins (audio/videocodec related). All plugins except one
Alright, currently I have my SWF hitting a php file that will go and
Alright, here's an odd one from an MS Access database I'm running. I have
Alright. I have a query that looks like this: SELECT SUM(`order_items`.`quantity`) as `count`, `menu_items`.`name`
Alright, so I have a query that looks like this: SELECT `orders`.*, GROUP_CONCAT( CONCAT(
Is it alright to expect that the user using the back end will have
Alright I have an xml document that looks something like this: <xml> <list> <partner>
Alright, I have a div which is 50px (height), and the width does not
Alright, I have library I wrote in C that reads a file and provides
Alright I want to create a .csv file in C#. I have been looking

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.