3
如何通過名稱獲得基類的方法的MethodReference?Mono.Cecil:從其他程序集調用基類'方法
我已經試過
type.BaseType.Resolve().Methods;
,如果我包含基類中的DLL添加到assemblyresolver它返回的方法。 但是如果我添加使用
MSILWorker.Create(OpCodes.Call, baseMethod);
(其中baseMethod被foreaching從解決類型定義的方法找到)的調用 產生的IL是不可讀的,甚至反射凍結和退出。
現在有的IL:
如果調用類型的私有方法:
call instance void SomeNamespace.MyClass::RaisePropertyChanged(string)
如果調用基類的保護方法:
call instance void [OtherAssembly]BaseNamespace.BaseClass::RaisePropertyChanged(string)
所以,我怎麼能生產出使用單聲道後者。塞西爾?
你能幫我解決我的類似問題嗎? http://stackoverflow.com/questions/4968755/mono-cecil-call-generic-base-class-method-from-other-assembly謝謝。 – TDaver 2011-02-15 08:50:46