0

I have a project that uses plugins based on an interface, they are coded in other "Class Library" projects in the same main project solution. The main project has a folder that contains all the plugins in dll format. So for example I have a Plugins folder in "Bin/Debug/". All the plugins are compiled on that directory.

Each plugin project has a reference to the main project as it uses the main framework (reference not copied locally).

Each plugin should be able to use methods from other plugins, here I have the problem.

Example:

I have PluginA and PluginB, 2 DLLs, 2 different projects but the DLLs are in the same Plugins folder.

Now I want to instantiate PluginB in PluginA class so I add a reference to PluginB DLL (not copied locally). No errors from the Compiler. But when I istantiate PluginA on the main project after loading all the plugins assemblies, I get a System.IO.FileNotFoundException Assembly or file not found. (referred to PluginB)

Basically seems that when I call a Plugin, from the main project, that calls another Plugin, I get an error. I've also tried to use the Assembly Resolve event without success.

Maybe I made some mistakes with the entire plugins system, it's the first time I use them.

Sorry for my english, I'm italian.

Thanks for the help.

Jester
  • 56,577
  • 4
  • 81
  • 125
  • Follow this link to [turn on Fusion logging](https://stackoverflow.com/questions/255669/how-to-enable-assembly-bind-failure-logging-fusion-in-net). The Fusion log shows any assembly binding failure, e.g. your file not found, and even lists all of the directories that it searched. My guess is you just need to set a [probing path](https://learn.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/runtime/probing-element). – John Wu Sep 09 '17 at 13:19
  • Thank you so much John Wu, it works! It's the first I hear about a probing path. – Fabrizio402 Sep 09 '17 at 14:15

0 Answers0