When we invoke a method via reflection, in case something goes wrong with type matching we get this error:
Object does not match target type.
This is a very poor message for debugging. Please give us more information. Something like:
You wanted to invoke SomeMethod and you passed X of type XType with value XValue and Y with type YType. These types do not match with what SomeMethod expects as its parameters A of type AType and B of type BType.
When we invoke a method via reflection, in case something goes wrong with type matching we get this error:
This is a very poor message for debugging. Please give us more information. Something like: