简体   繁体   English

InvokeMember调用引发MissingMethodException

[英]InvokeMember call is throwing MissingMethodException

I am invoking one of the functions from assembly but I am getting MissingMethodException. 我正在从汇编中调用功能之一,但正在获取MissingMethodException。 I have open exe in .netreflector and show that function is available at right place though it is giving error. 我在.netreflector中打开了exe文件,并显示该函数在正确的位置可用,尽管它给出了错误。 Here is the code. 这是代码。

private void button2_Click(object sender, EventArgs e)
 {
        Assembly obj = Assembly.LoadFrom("Solo4O.exe");
        Type datacrypt = obj.GetType("Orch.DC");

        object[] objects = new object[3];

.... ....

        datacrypt.InvokeMember("GetCryptedXML", BindingFlags.InvokeMethod |
                                                BindingFlags.Static |
                                                BindingFlags.Public,
                               null, datacrypt, objects, null);

}

Your target argument is datacrypt but it should be null , as you're calling a static method (and you're definitely not calling a method on datacrypt ). 您的target参数是datacrypt但应为null ,因为您正在调用静态方法(并且绝对不是 datacrypt 调用方法)。

Beyond that, it's hard to know exactly what's wrong, partly because you haven't shown how you've initialized objects ... we don't know what the types involved are. 除此之外,很难确切知道出了什么问题,部分原因是您还没有展示如何初始化objects ……我们不知道所涉及的类型是什么。 Please show more code. 请显示更多代码。 I strongly suspect that one of your argument types is invalid for the method call. 我强烈怀疑您的参数类型之一对于方法调用无效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用SQLiteAsyncConnection抛出MissingMethodException - Using SQLiteAsyncConnection throwing a MissingMethodException PrivateObject调用引发MissingMethodException - PrivateObject Invoke throwing MissingMethodException InvokeMember与常规方法调用 - InvokeMember vs normal method call 在InvokeMember调用期间引发NotSupportedException - NotSupportedException raised during InvokeMember call Dapper在应用程序中调用,并在DLL中调用抛出MissingMethodException - Dapper called in application, and called in DLL is throwing a MissingMethodException 通过InvokeMember调用从COM获取引用参数 - Getting ref parameter from COM with InvokeMember call 如何使用 InvokeMember 通过反射调用泛型方法 - How to call generic method by reflection using InvokeMember Invokemember方法无法在公共静态类下调用方法 - Invokemember method cannot call method under a public static class 如何使用HtmlElement.InvokeMember调用jQuery事件 - How to call jQuery event using HtmlElement.InvokeMember Cake构建脚本调用AWS.ElasticBeanstalk DescribeEnvironments()引发MissingMethodException - Cake build script calling AWS.ElasticBeanstalk DescribeEnvironments() throwing MissingMethodException
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM