Hi I have object which contains method:
{Boolean Deserialize(System.String, HardwareItemDescriptionControlDriver ByRef)}
when i am trying to find this method:
Type elementType = typeof(HardwareItemDescriptionControlDriver);
typesParameters = new Type[] { typeof(String), elementType.MakeByRefType() };
methodInfo = elementType.GetType().GetMethod("Deserialize", typesParameters);
methodInfo is null
I cant see where can be the problem – I also tryied to find this method with parameters:
typesParameters = new Type[] { typeof(String), elementType };
but it doesnt work neither, thanks!
You have a redundant
GetType();elementTypeis already theType:With the extra
GetType(), you are asking whetherSystem.Type(or more likely,RuntimeType) has that method (which: it doesn’t).