Question

What is the equivalent function of Type.MakeByRefType() in Mono.Cecil ?

For example:

Type xArgTypeDef;
xArgTypeDef = _method.DeclaringType;
xArgType.MakeByRefType()
Was it helpful?

Solution

TypeReference type = _method.DeclaringType;
ByReferenceType byRef = new ByReferenceType(type);

Easy as pie.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top