Behavior you are observing is expected - Type.GetType
typeName - The assembly-qualified name of the type to get. See AssemblyQualifiedName. If the type is in the currently executing assembly or in Mscorlib.dll, it is sufficient to supply the type name qualified by its namespace.
Note that your current code works because it falls under "currently executing assembly" portion of the specified behavior where just namespace+name is enough.
- You should specify full name of the type when requesting it, but you can check what namespace the type will use.
- You can switch to Assembly.GetType instead of
Type.GetType
and useT
's assembly to lookup types you want to create. - Alternative is to scan all loaded assemblies for type you want, but it may be not enough if the type is coming from not-yet-loaded assembly.
Remainder: namespace names in .Net don't mean much - they are convention to make code more readable, but there is no particular link between assembly and namespaces that are implemented in it.