load plugin error on plugin not in default path

Sep 14, 2008 at 10:14 AM
first ,thank's you work
now,program can found plugin.dll from other path,but can't load it.

error line:
LoadModules() function on PluginManager.cs

Assembly assembly = Assembly.Load(typeInfo.Location, evidence);
Sep 16, 2008 at 8:59 AM
The problem is in PluginFinder.cs in line 176:$0$0                $0$0plugin = new PluginTypeInfo(assembly.FullName, type, publicKey);$0$0$0$0$0The signature of c'tor is PluginTypeInfo(string assemblyLocation, Type type, byte[] publicKey), so, first parameter expected to be an absolute path, where assembly file are located. But passed only assembly.FullName property. $0$0 $0$0$0$0$0$0
Coordinator
Sep 16, 2008 at 9:58 AM
Ok, I've fixed that in the latest source code version. Thanks for taking the time and finding the bug.
Sep 16, 2008 at 10:08 AM
Thanks to you. You've done a great work!
Sep 16, 2008 at 11:39 AM
A last fix:$0In file PluginManager.cs, line 142:$0$0Change Assembly.Load call to Assembly.LoadFrom, because Assembly.Load is good only for GAC-ed or located in current directory assemblies.$0$0Assembly.LoadFrom works fine.$0$0$0
Sep 17, 2008 at 1:45 AM
$0is ok,$0$0Assembly assembly = Assembly.Load(typeInfo.Location, evidence);$0$0$0change to$0$0Assembly assembly = Assembly.LoadFrom(typeInfo.Location, evidence);$0$0
Nov 20, 2008 at 7:32 PM
Hi! It's me with bugs in plugin manager again!
After long time i've discovered that Assembly.LoadFrom causes unexpected behavior for plugins, that contains use(reference) some class libraries that not used by application code directly.
For example:
Application Directory:
- main.exe
- foo.dll /* called in main.exe - so it loaded in AppDomain gracefuly */
- bar.dll /* there are no calls to it library in main.exe, so it assembly will not be loaded */
-/Plugins
   - testPlugin.dll /* Use bar.dll, but Assembly.LoadFrom will not search for bar.dll in parent directory!  */

The reason of this is next - Assembly.LoadFrom accepts assembly name, not it path. I don't know, why Assembly.LoadFrom accepts file path (Maybe, it use it like UNC path..don't know), but it works on simpe use cases. Fortunately method Assembly.LoadFile resolves all it's issues. 
Coordinator
Dec 10, 2008 at 1:16 PM
Feel free to create a patch with the changes.