Hey,

One thing: you're not setting the HasThis bit of the new MethodReference.

Let me know if that helps,
Jb

On Wed, Feb 17, 2016 at 3:17 AM, Dudi Keleti <[email protected]> wrote:
> Thanks for the answer.
>
> Yes, Iv'e got MissingMethodException that said: "Method not found: 'object
> c.b__0_0(System.__Canon)'."
>
> In  ILSpy, the method iv'e generated with Cecil look like this:
>
>  MethodBase.GetMethodFromHandle(methodof(x<T>.c.b__0_0(T)).MethodHandle,
> typeof(x<T>.c).TypeHandle);
>
> To me it's look good but still as I said, I've got an exception.
>
> The steps I do are as the following:
>
> Load the assembly that contains these types
> Find and invoke the 'm0' method
> Invoke the returned Func<T, object> from m0 with concrete T
>
> And in step 3 I've got the MissingMethodException
>
> I must say the PEVerify also warning me that he couldn't find b_00_0 method
> but this is happen only after I weaved the PE. (In the original PE PEVerify
> is happy about b__0_0)
>
> Also if it was a non generic type and I do the ldtoken with the method
> definition I have, everything works great.
> Is it seems correct to create a new method reference with the generic type
> to get the correct method?
>
> Thank for the help
>
>
> On Tuesday, February 16, 2016 at 8:34:29 PM UTC+2, Jb Evain wrote:
>>
>> Hey,
>>
>> There's nothing wrong here that jumps at me.
>>
>> System._Canon is an implementation detail of the .NET framework. It
>> doesn't necessarily mean you're doing something wrong here.
>>
>> Do you get a runtime exception when invoking it?
>>
>> Thanks,
>> Jb
>>
> --
> --
> --
> mono-cecil
> ---
> You received this message because you are subscribed to the Google Groups
> "mono-cecil" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.

-- 
-- 
--
mono-cecil
--- 
You received this message because you are subscribed to the Google Groups 
"mono-cecil" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to