1
Answer

loading a DLL that sits on another server

Ask a question
Lamont Jones

Lamont Jones

14y
2.2k
1

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)