471,603 Members | 1,581 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,603 software developers and data experts.

Plugin assembly path to find other needed assemblies

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


Jan 13 '06 #1
2 2628
Luis Arvayo wrote:
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

--
------------------------------------------------------------------------
Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
Jan 13 '06 #2
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
"Frans Bouma [C# MVP]" <pe******************@xs4all.nl> escribió en el
mensaje news:xn***************@news.microsoft.com...
Luis Arvayo wrote:
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

--
------------------------------------------------------------------------
Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------

Jan 13 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Rudolf | last post: by
2 posts views Thread by Matt | last post: by
reply views Thread by David Levine | last post: by
10 posts views Thread by jojobar | last post: by
reply views Thread by Zeya | last post: by
3 posts views Thread by Tim | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by MichaelMortimer | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.