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