Plugin assembly path to find other needed assemblies

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Luis Arvayo

    #1

    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\applic ation.exe

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

    c:\myapp\assemb ly1.dll
    c:\myapp\assemb ly2.dll


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

    c:\myapp\Plugin s\plugin1.dll

    But plugin1.dll also depends on

    c:\myapp\assemb ly1.dll

    as same as application.exe .

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

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

    Thanks in advance
    Luis Arvayo




  • Frans Bouma [C# MVP]

    #2
    Re: Plugin assembly path to find other needed assemblies

    Luis Arvayo wrote:
    [color=blue]
    > 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\applic ation.exe
    >
    > then, other assemblies are also installed on the same subdirectory,
    > example:
    >
    > c:\myapp\assemb ly1.dll
    > c:\myapp\assemb ly2.dll
    >
    >
    > Then in subdirecory Plugins under main subdirectory I installed the
    > plugins:
    >
    > c:\myapp\Plugin s\plugin1.dll
    >
    > But plugin1.dll also depends on
    >
    > c:\myapp\assemb ly1.dll
    >
    > as same as application.exe .
    >
    > When runtime, there is an error when loading the assembly (with
    > Assembly.Load(x xx)) that dependant assemblies on plugin1.dll were not
    > found (c:\myapp\assem bly1.dll).
    >
    > How to solve this without moving the plugins assemblies to the main
    > subdirectory ?[/color]

    In the application.exe .config file, add:
    <runtime>
    <assemblyBindin g xmlns="urn:sche mas-microsoft-com:asm.v1">
    <probing privatePath="Pl ugins"/>
    </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#)
    ------------------------------------------------------------------------

    Comment

    • Luis Arvayo

      #3
      Re: Plugin assembly path to find other needed assemblies

      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(x xx)

      Regards
      Luis Arvayo


      "Frans Bouma [C# MVP]" <perseus.usenet NOSPAM@xs4all.n l> escribió en el
      mensaje news:xn0eh6jlg4 nnil004@news.mi crosoft.com...[color=blue]
      > Luis Arvayo wrote:
      >[color=green]
      >> 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\applic ation.exe
      >>
      >> then, other assemblies are also installed on the same subdirectory,
      >> example:
      >>
      >> c:\myapp\assemb ly1.dll
      >> c:\myapp\assemb ly2.dll
      >>
      >>
      >> Then in subdirecory Plugins under main subdirectory I installed the
      >> plugins:
      >>
      >> c:\myapp\Plugin s\plugin1.dll
      >>
      >> But plugin1.dll also depends on
      >>
      >> c:\myapp\assemb ly1.dll
      >>
      >> as same as application.exe .
      >>
      >> When runtime, there is an error when loading the assembly (with
      >> Assembly.Load(x xx)) that dependant assemblies on plugin1.dll were not
      >> found (c:\myapp\assem bly1.dll).
      >>
      >> How to solve this without moving the plugins assemblies to the main
      >> subdirectory ?[/color]
      >
      > In the application.exe .config file, add:
      > <runtime>
      > <assemblyBindin g xmlns="urn:sche mas-microsoft-com:asm.v1">
      > <probing privatePath="Pl ugins"/>
      > </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#)
      > ------------------------------------------------------------------------[/color]


      Comment

      Working...