Hello, All you need to do is to use Instruction.Create(iOpCode, newf)
:) Jb On Mon, May 16, 2016 at 3:30 AM, k sg <[email protected]> wrote: > i really want to do "new Instruction(i.OpCode, ??)" in my code. > > but it generate under the error; > > > Error 3 'Mono.Cecil.Cil.Instruction' does not contain a constructor that > takes 2 arguments' > > > FieldReference fref = operand as FieldReference; > > FieldReference newf = targetModule.Import(fref); > > col.Add(new Instruction(i.OpCode, newf)); > > continue; > > } > > if (operand is TypeReference) > > { > > TypeReference tref = operand as TypeReference; > > TypeReference newf = targetModule.Import(tref); > > col.Add(new Instruction(i.OpCode, newf)); > > continue; > > } > > if (operand is TypeDefinition) > > { > > TypeDefinition tdef = operand as TypeDefinition; > > TypeReference newf = targetModule.Import(tdef); > > col.Add(new Instruction(i.OpCode, newf)); > > > > Please help me > > -- > -- > -- > 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.
