Hi JB,

The start is a call to int.ToString() in my assembly that I want to
change. Now I am taking the DeclaringType of this function and use it
a ref parameter in a new created function.

code is something like
MethodReference mr = instruction.Operand
TypeReference tr = mr.DeclaringType
ParameterDefinition p = new ParameterDefinition(new
ReferenceType(tr));

I have tried .Resolve() and module.Import() at various places but
without success. It seems that the tr is always refering to the wrong
(my) assembly.

Jan


On 30 Apr., 02:30, Jb Evain <[email protected]> wrote:
> Hey,
>
> On Thu, Apr 29, 2010 at 2:46 PM, Jan <[email protected]> wrote:
> > I am adding a ref param to a new generated function. The ref is
> > generated by using 'new ByReferenceType'.
>
> > Peverify tells me:
>
> > [MD]: Error: Signature contains long form (such as
> > ELEMENT_TYPE_CLASS<token of S
> > ystem.String>). [token:0x06000151]
>
> > Is there anything I have to call on the ref or on the paramater to
> > avoid this peverify error?
>
> Are you creating yourself a TypeReference to System.String ?
>
> --
> Jb Evain  <[email protected]>
>
> --
> --
> mono-cecil

-- 
--
mono-cecil

Reply via email to