Matt

Matt

  • NA
  • 1
  • 0

Inheriting from dynamically loaded library

Jul 31 2009 7:06 AM

Hi, I have a library that is under heavy development and have stored it on a shared drive.  I have used caspol so that the shared drive is trusted by .net.  The library contains various classes that are designed to be inherited by the application classes. 
I am adding an event handler to load the library assembly at run time to the various applications that use the library.  When I'm using static classes from the library, this works fine.  The following doesn't work, I get an exception that it can't find the library file.  B is a class in the library.
 

public class A : B
{
   //called from Main which has an event handler to load the library
  public static go(args){}

If I try debugging, it's not even getting to the first line before triggering the exception. The exception is being thrown before the event handler to load the library is being triggered.  For now I am placing the library in the GAC, but this means I have to replace it on all the development machines every time it gets updated, which is a lot.  I'm assuming that .net needs information from the library before it hits Main().
Is there any method I can use to inherit from classes in dynamically loaded libraries?
Thanks,
Matt