Plugin assembly path to find other needed assemblies

  • Thread starter Thread starter Luis Arvayo
  • Start date Start date
L

Luis Arvayo

Actually it is:

How to define the plugin assemblies path in order to find other assemblies
which the plugin depends on.

Example:

If I have:

c:\myapp\application.exe

then, other assemblies are also installed on the same subdirectory, example:

c:\myapp\assembly1.dll
c:\myapp\assembly2.dll


Then in subdirecory Plugins under main subdirectory I installed the plugins:

c:\myapp\Plugins\plugin1.dll

But plugin1.dll also depends on

c:\myapp\assembly1.dll

as same as application.exe.

When runtime, there is an error when loading the assembly (with
Assembly.Load(xxx)) that dependant assemblies on plugin1.dll were not found
(c:\myapp\assembly1.dll).

How to solve this without moving the plugins assemblies to the main
subdirectory ?

Thanks in advance
Luis Arvayo
 
Luis said:
Actually it is:

How to define the plugin assemblies path in order to find other
assemblies which the plugin depends on.

Example:

If I have:

c:\myapp\application.exe

then, other assemblies are also installed on the same subdirectory,
example:

c:\myapp\assembly1.dll
c:\myapp\assembly2.dll


Then in subdirecory Plugins under main subdirectory I installed the
plugins:

c:\myapp\Plugins\plugin1.dll

But plugin1.dll also depends on

c:\myapp\assembly1.dll

as same as application.exe.

When runtime, there is an error when loading the assembly (with
Assembly.Load(xxx)) that dependant assemblies on plugin1.dll were not
found (c:\myapp\assembly1.dll).

How to solve this without moving the plugins assemblies to the main
subdirectory ?

In the application.exe.config file, add:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="Plugins"/>
</assemblyBinding>
</runtime>

This will tell fusion to look in the subfolder Plugins for referenced
assemblies as well. Check the probing tag's documentation for more
details :)

Frans

--
 
Thanks for the answer, but...

Your suggestion works only for the main application which I already had
defined before posting. But it seems that it is ignored for the plugin,
because the error is raisee when issued the Assembly.Load(xxx)

Regards
Luis Arvayo
 
Back
Top