我有这样的代码:
class Program
{
static void Main(string[] args)
{
Assembly myAsm = Assembly.LoadFile(@"c:\Some.dll");
Type myService = myAsm.GetType("SomeClass");
String s = (String) myService.InvokeMember("SomeMethod", BindingFlags.InvokeMethod | BindingFlags.Public,
null, null, new object[] {"MyParam"});
}
}
在 Some.Dll 中有公共静态方法 SomeMethod 与字符串参数返回字符串,但我得到方法丢失错误...