No reproduction. Run this sample:
var hardCodedWorking = Type.GetType("System.String"); var stringName = "String"; var concatenatedWorking = Type.GetType("System." + stringName); var badStringName = "string"; var concatenatedNull = Type.GetType("System." + badStringName);
From Type.GetType () on MSDN:
Returns the type with the specified name using case-sensitive search.
Based on this and my example above, I believe that most likely the value of name
does not match the class name
perfectly.
source share