Re: C# DLL-plugin references




"Tim" <Tim.Vanlaere@xxxxxxxxx> wrote in message
news:1184164099.922590.145970@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,

I've been struggling for a while trying to run plugins in C#, which
have external references.
The plugins load, and I can invoke methods through reflection until
the method uses some code defined in an external assembly.

The error returned is in all cases:

"Could not load file or assembly 'MyAssName, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null' or one of its dependencies. The
system cannot find the file specified.".

The only sollution I could find so far, is to manually add references
to these assemblies in the host project, which defies the purpose of
the plugin-system.

Is there a way, without using the GAC, to reference these assemblies
at runtime?

The way I do it, is after I load each assembly, iterate through its
dependencies, and for each assembly not yet loaded, try to load it from the
plugin directory as well.


Thanks in advance,
Tim



.



Relevant Pages

  • Plugin assembles best practices
    ... This will be a large system with dozens of plugins. ... there are a number of assemblies ... all assemblies searching for plugins to load. ... There is no global naming scheme we need to maintain or enforce. ...
    (microsoft.public.dotnet.languages.csharp)
  • Plugin assembles best practices
    ... This will be a large system with dozens of plugins. ... there are a number of assemblies ... all assemblies searching for plugins to load. ... There is no global naming scheme we need to maintain or enforce. ...
    (microsoft.public.dotnet.framework)
  • C# DLL-plugin references
    ... The plugins load, and I can invoke methods through reflection until ... The only sollution I could find so far, is to manually add references ... Is there a way, without using the GAC, to reference these assemblies ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Which referenes being used?
    ... >>> Not much if any size difference, but it will load a little faster ... >>> system doesn't need to locate and open the referenced assemblies. ... > included in your project settings (used by the compiler) but aren't ... Appreciate any references you can provide. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Checking for implementation of an interface
    ... > I have an application that accepts plugins. ... > checking the assemblies in the plugins folder to see if they implement ... If I load each assembly and check it, ... > interface once its loaded into the separate appdomain. ...
    (microsoft.public.dotnet.framework)