MSIL - how do you invoke a private method from MSIL?

后端 未结 3 1172
礼貌的吻别
礼貌的吻别 2021-01-02 20:04

I\'m writing a \"weak event factory\" - code which converts any Delegate into a new delegate with an identical signature, but with implementing a WeakReference on the target

3条回答
  •  遥遥无期
    2021-01-02 20:44

    Are you inserting your IL into a DynamicMethod or into a method within a dynamic assembly? As I understand it, there is no way to skip visibility checks from within a dynamic assembly, but you can skip them when using a DynamicMethod (see here).

提交回复
热议问题