Jb, While your code worked at compile time, I'm not sure it worked at run time. On the original code that I was trying to rewrite, the reference was for a Get(Int32,Int32), and my reference was only a Get().
Anyways, I've attempted another approach to my problem, and for now I have a workaround. Thanks, BBF On Jun 16, 3:35 am, Jb Evain <[email protected]> wrote: > Hey, > > On Thu, Jun 16, 2011 at 4:08 AM, BBF <[email protected]> wrote: > > var elem = ClassB.foo[2,3]; > > > So I would do something like: > > > Ldsfld FieldReference( ClassB.foo ) > > ldc.i4.2 > > ldc.i4.3 > > ........... <-- call ClassA[...,...]::Get > > > How can I reference the MethodReference "Get" of this array > > programatically ? > > var classA = module.Import (classA); // get a reference to classA > var classAarray = new ArrayType (classA, 2); // 2 is the rank > var get = new MethodReference ("Get", classA, classAarray); > > Jb -- -- mono-cecil
