I am trying to get an object using Reflection, and then launch a method on that object. I was getting null from Type.GetType("my.namespace.item") so I decided to try a test that SHOULD work. Using this code Type.GetType((new my.namespace.item()).GetType().FullName) I still get null.
That should not happen from what I understand. What am I doing wrong?
You’re only specifying the
FullNameof theType, which is (ironically) not the full name you need.Type.GetType(string)requires theAssemblyQualifiedNameof theTypein order to work:should be fine. Specifying it manually would look like:
Obviously you can omit the Version, Culture, or PublicKeyToken if they don’t apply.