Lamont Jones

Lamont Jones

  • NA
  • 16
  • 0

loading a DLL that sits on another server

Jan 20 2010 3:13 PM

Can you load a DLL that sits on another server? What if filename was a network path, will this work?
static void CallFoo(string filename)
{
   try
   {
      string fullFileName = new System.IO.FileInfo(filename).FullName;
      Assembly assembly = Assembly.LoadFile( filename );
      foreach( Type type in assembly.GetTypes() )
      {
         MethodInfo foo = type.GetMethod( "foo" );
         foo.Invoke(type, new object [] {} );
      }
   }
   catch( Exception e )
   {
      System.Console.WriteLine("{0}",e);
   }
}

Answers (1)