typeof(T).AssemblyQualifiedName returning null
c#, reflection
Solution
Well `AssemblyQualifiedName` can return null:
The assembly-qualified name of the Type, which includes the name of the assembly from which the Type was loaded, or null if the current instance represents a generic type parameter.
It doesn't look like it should actually represent a generic type parameter if you're really just using `typeof(T)` - unless the generic method is being called via reflection in some bizarre way.
Why are you trying to use `Type.GetType` though? It sounds like all you need is
var type = typeof(T);
... wouldn't that do exactly what you want? Why go via the name of the type?
Problem
I've been working with some code that I needed to add a module too and I thought I had everything set up correctly but this last bit has got me stumped. It seems relatively simple, I'm passing in a type to a Generic Method ``` var name typeof(T).AssemblyQualifiedName; ``` So that I can then do this ``` var type = Type.GetType(name); ``` however it's throwing an exception at that last line with `name` being `null` I've been reading around type reflection I know that `GetType` expects the fully qualified assembly name but I don't understand why it's coming back as null. Does it mean I'm doing something fundamentally wrong with my code as i assumed that `AssemblyQualifiedName` is emitted from a type as it knows how it's been referenced?