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);
}
}