Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. Plugins and Assembly References

Plugins and Assembly References

Scheduled Pinned Locked Moved .NET (Core and Framework)
helpcsharpdotnetquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Steven M Hunt
    wrote on last edited by
    #1

    Hello. I am designing an application that will make use of plugins (.net assemblies loaded at runtime containing classes implemented from a common interface). The issue is, i would like to be able to put these DLLs in a folder other than the application's folder, so it could be in a folder like \Plugins\ or something. It works fine sometimes, the problem is that when a plugin references a local assembly, it tries to find it in the application's folder and not the plugin's folder. For instance, if one of the plugins is loading XLS files and I have an XLS file reader class in a seperate assembly along with the plugin, I will get an error since the application is trying to load the assembly from its location and not the plugin's location. Is there any way to get around this without dumping my assemblies in the GAC?

    -- Steven Hunt

    E 1 Reply Last reply
    0
    • S Steven M Hunt

      Hello. I am designing an application that will make use of plugins (.net assemblies loaded at runtime containing classes implemented from a common interface). The issue is, i would like to be able to put these DLLs in a folder other than the application's folder, so it could be in a folder like \Plugins\ or something. It works fine sometimes, the problem is that when a plugin references a local assembly, it tries to find it in the application's folder and not the plugin's folder. For instance, if one of the plugins is loading XLS files and I have an XLS file reader class in a seperate assembly along with the plugin, I will get an error since the application is trying to load the assembly from its location and not the plugin's location. Is there any way to get around this without dumping my assemblies in the GAC?

      -- Steven Hunt

      E Offline
      E Offline
      Eugene Ciloci
      wrote on last edited by
      #2

      Hi Steven, I'm assuming that the Plugins folder is a subdirectory of the executable's folder. In that case, you should be able to use the Probing element in the app.config file to have the runtime look for assemblies in that folder. Also, you can read up on the whole process: How the Runtime Locates Assemblies Hope that helps, Eugene

      S 1 Reply Last reply
      0
      • E Eugene Ciloci

        Hi Steven, I'm assuming that the Plugins folder is a subdirectory of the executable's folder. In that case, you should be able to use the Probing element in the app.config file to have the runtime look for assemblies in that folder. Also, you can read up on the whole process: How the Runtime Locates Assemblies Hope that helps, Eugene

        S Offline
        S Offline
        Steven M Hunt
        wrote on last edited by
        #3

        Thanks for the help. I also discovered Assembly.LoadFrom(string location), which also looks promising.

        -- Steven Hunt

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups