mono-如何将ref与CreateInstance或InvokeMethod一起使用?

mono-如何将ref与CreateInstance或InvokeMethod一起使用?,mono,out,ref,createinstance,invokemember,Mono,Out,Ref,Createinstance,Invokemember,如何在Mono中使用CreateInstance传递“ref” 例如: public MyMethod(ref SomeType data) {... ... SomeType st = new SomeType(); object handle = Activator.CreateInstance(type, new object[] { st }); 这在我的windows控制台应用程序中运行良好。问题是,当我将它移植到Mono时,我得到一个缺少的方法异常,指出没有找到接受类型“SomeT

如何在Mono中使用CreateInstance传递“ref”

例如:

public MyMethod(ref SomeType data) {...
...
SomeType st = new SomeType();
object handle = Activator.CreateInstance(type, new object[] { st });
这在我的windows控制台应用程序中运行良好。问题是,当我将它移植到Mono时,我得到一个缺少的方法异常,指出没有找到接受类型“SomeType”的“MyMethod”

如果我从构造函数中删除'ref',Mono将找到该方法并运行它,而不会出现任何问题

有什么想法吗


提前感谢。

这是2.6版之前的Mono的一个问题。修复地址通过引用传递给CreateInstance。

请在(Mono Bugzilla)上提交一个错误[说明您使用的是哪个Mono版本。完成,关闭。结果表明,此问题在Mono版本2.6之后得到修复(不确定确切版本)。