Why would System.Type.GetType(“Xyz”) return null if typeof(Xyz) exists?
I have come across a strange behaviour in my (huge) .NET 4 project. At some point in the code, I am referring to a fully qualified type, say: System.Type type = typeof (Foo.Bar.Xyz); later on, I do this: System.Type type = System.Type.GetType ("Foo.Bar.Xyz"); and I get back null . I cannot make sense of why this is happening, because my type name is correct, and I have checked with other types and they get resolved properly. Moreover, the following LINQ query finds the type: var types = from assembly in System.AppDomain.CurrentDomain.GetAssemblies () from assemblyType in assembly.GetTypes ()