I am using the following code:
Type type = info.ParameterType;
object activatedType = Activator.CreateInstance(type);
arguments[info.Position] = activatedType;
The problem is that type may end up being a pointer reference to a certain type, like System.String& (note the &), so how can I get the underlying type of System.String?
Essentially, how do I dereference an unknown type to its underlying type?
If you want to get a reference type from another type, you can use MakeByRefType: